Setting Default Role on user sign up

Hello,

Is there a way of setting a default Role e.g Customer with desk access and other access rights so that everyone who signs up get assigned to that Role by default.

Maybe even assigning that default role when posting a new user through REST API.

Kr,
Oasis

See Portal Settings

5 Likes

Where can I set the default role for users signing up with LDAP? It is currently “Blogger”. We want to have them as webshop customers, as all customers are in LDAP.

New LDAP users seem to be hardcoded to become a “Blogger” in frappe/ldap_settings.py at 387f556dd5c241fa3b223884ce7e3a79f864c9c1 · frappe/frappe · GitHub

PROPOSAL: add “Default role for new user” to LDAP settings DocType

Workaround done: add to role blogger the permissions “Request” und “Invoice” and remove permission to use desktop

After migrating to v11, by adding all permissions of the role “Customer” to “Blogger” seems not to be sufficient anymore to allow a “Blogger” to finish an order in the webshop. It ends up with a window showing “Customer” - required to login. But the user had already logged in.

SO-not-allowed

I finally made it working by patching frappe/integrations/doctype/ldap_settings/ldap_settings.py#L133 and replacing Blogger with Customer

I’m just getting some ldap changes merged at the moment, but your idea is a good one, I’ll submit a pr with this as an option

1 Like

@cjpit I submitted already a PR Apply Customer role instead of Blogger by rasos · Pull Request #7448 · frappe/frappe · GitHub - maybe this simple one is then obsolete.

However, it turns out, that a new user with role “customer” has to exist in ERPnext before user can login. This restriction (which we do not have for the role “blogger”) does not allow to sign up. No idea where this is being configured, definetely not in the permissions list.

Remember, our use case is allowing LDAP users to sign up first time when ordering an item in the web shop.

Hi @rasos , I’d make the option generic, so you can choose what role you want the user to be on creation/login. We also have a requirement to map ldap roles to erpnext roles, so I’ll add that option as well.

1 Like