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

Unable to signup unless logged in with Admin account #232

Open
jagzviruz opened this issue Jun 12, 2016 · 4 comments
Open

Unable to signup unless logged in with Admin account #232

jagzviruz opened this issue Jun 12, 2016 · 4 comments

Comments

@jagzviruz
Copy link

jagzviruz commented Jun 12, 2016

I am unable to create users unless I have logged in using default Admin credentials. I have tried this with both UI and POSTMAN, to the same effect.
I have tested it with a fresh sails project with just sails-auth and sails-permissions modules added.

@kakadiadarpan
Copy link

Facing the same issue.

@BaggersIO
Copy link

Same problem here.

@pnolin
Copy link

pnolin commented Jul 29, 2016

If you use sails-auth in combination with sails-permission, you can add this in policies.js
UserController: {
create: [],
'*': [
'basicAuth',
'passport',
'sessionAuth',
'ModelPolicy',
'AuditPolicy',
'OwnerPolicy',
'PermissionPolicy',
'RolePolicy',
'CriteriaPolicy'
]
}

This will allow you to create a user without being loged in. The created used will have the registered role.

Hope this help!

@rafaelmlourenco
Copy link

I'm having the same problem here. Thanks to @nolife9face we have a working workaround. But wouldn't be a more 'correct' way to change the PermissionPolicy so that if the user isn't registered it should be treated like 'public' role? That way, we would grant the permissions we would want for unregistered users using the PermissionService, for example on '.config/bootstrap.js'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants