sails-permissions
sails-permissions copied to clipboard
Unable to signup unless logged in with Admin account
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.
Facing the same issue.
Same problem here.
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!
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'.