How to give the role of "Website User" to current list of customers?

Currently I have a list of users with the role of “Customer”.
I would like to add the role “Website User” to the list of users.

Tried selecting the users by ticking them and then going to the button on top right called “Actions”. Then selected “Edit”.

The closet option I got was “Role Profile”. I could not find “Role”.
Am I missing a step?

@pvanthony Website User is not a role in User Doctype its a user type. if you want to change the user type from System User to Website User you can directly change the value in the User Type field

thank you for the reply.

My bad. It is a custom role called “Website User”. I need to add this custom role for a list of customers.

Is there a way to do it?

P V Anthony

Hi @pvanthony

The following are website users having dedicated portal access as following;

  1. Customer
  2. Supplier
  3. Student
  4. Patient

Particularly for customer role, you can add or remove role permissions for a doctype by working with Role Permission Manager but those are limited to desk access only.

For portal access controls, each web form has to be marked ON with permissions and then only website user like customer can be granted defined access for particular web forms as well.

Thank you for the reply.

Let me rephrase my question.

Lets say there are 200 users in erpnext.
I need to add the role “Stock User” to these 200 users.

How can I do this?

I tried selecting the 200 users and pressing the “Action” > “Edit”.
But there is no “Role” to select. The closest I got was “Role Profile”.

Is there a way to add the role “Stock User” to these 200 users?

Hi there,

Role assignments are registered in the User doctype via a child table “Has Role”. To my knowledge, it’s not possible to edit child docs from the parent doc list view.

If this is a one-time thing, the easiest way to do this would probably be a bit of Python in the system console. If you do it often, it might be worth building a custom tool of some sort. I’m not aware of anything that does this out of the box.

Edited to add: You might also just be able to create a role profile for this purpose, then set that via the list view. It should work but I haven’t tested it.

Thank you for the advice.

Good that this is settled. So it cannot be done in the gui.

Now have to explore other ways.

Just a thought. Would the following be a safe way to to achieve the similar outcome?

  • create a Role Profile, like “UserProfile” which includes “Stock User” role.
  • select users which need the change.
  • press “Action” button on top right
  • select “Edit”
  • then select “Role Profile”
  • choose the role profile, UserProfile".
  • press apply.

Is the above way ok? Any pitfalls? Anything to be concerned with?

Yep, that’s exactly what I was suggesting above in my edit. I would assume this works, though like I said I haven’t tested it. I can’t think of any hidden pitfalls. If it looks like it’s working, it is.

The reason that this is a bit more complicated than it would initially appear is related to how the data structure here needs to be set up. “Stock User” looks like a field, but it isn’t. There’s some scripting work on the back end that has to translate between Role Profiles and specific Role Assignments.

Thank you for the reply and advice.

Good information.