Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't have any user roles created on first creation of app #404

Closed
futbotism opened this issue Dec 22, 2017 · 2 comments
Closed

Don't have any user roles created on first creation of app #404

futbotism opened this issue Dec 22, 2017 · 2 comments
Assignees
Labels
issue: bug Issue reporting a bug severity: critical If the issue has a security impact or breaks core usage of the product

Comments

@futbotism
Copy link

Node.js version: v7.6.0
npm version: 4.1.2
Strapi version: 3.0.0-alpha.7.2
Operating system: mac osx high sierra

When i load the Auth & Permissions section of the admin interface the http://localhost:1337/users-permissions/roles doesn't load and i get a {"statusCode":400,"error":"Bad Request","message":[{"messages":[{"id":"Not found"}]}]}

there doesn't seem to be a guest or admin role

This may be related, when i run strapi start i get the console error

    /Users/andrewalvino/Documents/projects/velocity/velocity-api/plugins/users-permissions/services/UsersPermissions.js:121
    )
    ^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Strapi.loadFile (/Users/andrewalvino/Documents/projects/velocity/velocity-api/node_modules/strapi/lib/utils/index.js:18:14)
    at Object.setConfig (/Users/andrewalvino/Documents/projects/velocity/velocity-api/node_modules/strapi/lib/utils/index.js:32:19)
@futbotism
Copy link
Author

futbotism commented Dec 22, 2017

when i changed the formatting in .../myproject/plugins/users-permissions/services/UsersPermissions.js to,

getRoleConfigPath: () => (path.join(strapi.config.appPath,'plugins','users-permissions','config','roles.json')),

It worked 👍

@lauriejim lauriejim self-assigned this Jan 4, 2018
@lauriejim lauriejim added severity: critical If the issue has a security impact or breaks core usage of the product issue: bug Issue reporting a bug version: 3.x labels Jan 4, 2018
@lauriejim
Copy link
Contributor

Hello @futbotism , thank you for this issue.
If you upgrade to node 8 and npm 5 it will fix this problem.

Can you make a PR with your changes please. It will help users who use node 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: critical If the issue has a security impact or breaks core usage of the product
Projects
None yet
Development

No branches or pull requests

3 participants