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

Custom user roles and permissions #192

Open
6 tasks
faierbol opened this issue Apr 8, 2022 · 7 comments
Open
6 tasks

Custom user roles and permissions #192

faierbol opened this issue Apr 8, 2022 · 7 comments

Comments

@faierbol
Copy link

faierbol commented Apr 8, 2022

I would like to see an option to create some customer roles with granulated permissions.

Example of what i would like to see, basically an admin will be able to:

  • create a new role
  • assign granulated permissions
  • assign custom fields to this role -> company name, username, website etc (select which fields will be used when signup if signup with this role is enabled)
  • enable or disable -> user can sign-up with this role on frontend

Example of roles:

  • Moderator role -> this role cannot be used for registration (it will be assign manually by an admin) and it has access to the admin panel but only for some fields or sections like editing/ approving posts.
  • Company role -> this role can be selected when registering on the site and it has access only on the frontend of the site. This role has different fields other than the usual user role, like example instead of the name and last name it has the company name and son.
@robodove
Copy link

this is being worked on right now #194

please comment on the pr and explain if that specification fits your use cases

@eilrix
Copy link
Member

eilrix commented Apr 22, 2022

Thanks, fair requirements! I'll work on my PR to add signup role and custom fields features.
@faierbol can you pls explain the part:

select which fields will be used when signup

How do we use them?

@eilrix
Copy link
Member

eilrix commented Apr 22, 2022

@playrich any entity has isEnabled flag. You can use it on the frontend to disable the role. I'll configure backend to reject such role for auth

@faierbol
Copy link
Author

Thanks, fair requirements! I'll work on my PR to add signup role and custom fields features. @faierbol can you pls explain the part:

select which fields will be used when signup

How do we use them?

i was thinking as follows: create a role > assign permissions > chose if this role can be used when registering the site, basically ïsEnabledForRegistering field or something like this.

@faierbol
Copy link
Author

faierbol commented Apr 22, 2022

besides permissions we would be able to select or create new fields for this role like instead of name a custom role will have company name, now when creating a custom role the entire flow will be as follows: create. anew role > assign permissions > create or select existing fields (username, name, password etc) > chose if this role can be used when registering the site, basically ïsEnabledForRegistering > chose what fields will be displayed when registering on the frontend signup form, if registration is enabled for this role

@robodove
Copy link

besides permissions we would be able to select or create new fields for this role like instead of name a custom role will have company name, now when creating a custom role the entire flow will be as follows: create. anew role > assign permissions > create or select existing fields (username, name, password etc) > chose if this role can be used when registering the site, basically ïsEnabledForRegistering > chose what fields will be displayed when registering on the frontend signup form, if registration is enabled for this role

this is theme related and theme authors can implement this feature

the cms itself will be able to handle this case

signup forms on the theme are something that the base system should not care about

@eilrix
Copy link
Member

eilrix commented Apr 22, 2022

@playrich right, theme authors can configure these forms. Another part of the question is what roles backend should accept for signup. Right now there's one signup role customer, but after refactor this role can be removed and created several new.

So we need to have isEnabledForRegistering in roles table, or maybe have a list of these roles in CMS settings?

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

3 participants