sails-permissions icon indicating copy to clipboard operation
sails-permissions copied to clipboard

Unable to signup unless logged in with Admin account

Open jagzviruz opened this issue 8 years ago • 4 comments

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.

jagzviruz avatar Jun 12 '16 05:06 jagzviruz

Facing the same issue.

kakadiadarpan avatar Jun 14 '16 13:06 kakadiadarpan

Same problem here.

BaggersIO avatar Jul 11 '16 12:07 BaggersIO

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!

pnolin avatar Jul 29 '16 20:07 pnolin

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'.

rafaelmlourenco avatar Nov 01 '16 10:11 rafaelmlourenco