-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Standalone login ux #26684
Standalone login ux #26684
Conversation
…ser for roles; update tests The role table only held a string; using OptionValue enables us to have translatable values etc. Also it enables us to use a bookend multi value in user roles, which should be fine as it's rarely searched.
(Standard links)
|
Also see civicrm/civicrm-buildkit#787 |
@totten I assume you have seen this @artfulrobot this is wholly contained within the standalone extension so it's up to you if you want to self-merge this now (or I can) or whether you are wanting to get some pre-merge collaboration |
@artfulrobot Yeah, mapping-entities like So I definitely see the case for converting entity I'm not as keen about converting It seems to me that the model would be more intuitive if you had:
Aside: I think there's an interesting conversation to have about defaults and packaging for roles/permissions... But that maybe a separate issue/chat. |
OK, so how it relates here: suppose you're packaging-up a
|
@artfulrobot does this support the idea a user could have multiple roles at once? |
@seamuslee001 yep. |
I hadn't envisaged packaging a role. Can we package CMS roles? I suppose it provides a way to ship sensible defaults, but I always think permissions are best considered case by case.
Currently the values from the optionValue stored in User.roles are (string-encoded) integers. I guess this would be the same but pointing to To confirm my understanding: I don't think this one has any advantage in terms of packaging roles; I think we can package an optionvalue just the same as a role.
Permissions are strings. So this means Therefore this is simpler to package because the role's permissions aren't in a separate, dependent table with FKs to the newly created role. Makes sense. OK I'll try moving to that model. I also like it from an API permissions POV, as it's easier to apply permissions to an entire entity (Role) than it is to a subset of optionvalues (those that belong to the Role optiongroup). One thing I'm not looking forward to is replacing the role-permissions edit UI. I believe I could do a multiselect (like in the screenshot of user-roles in my previous comment) but that would be really ugly for a huge list that needs explaining. Would you advise that I do a separate angular app for handling that UX or do you think this is something afform can handle (and if so I'm definitely going to need some pointers). |
@totten Have a look at this latest, which I think, does things as you suggested. Everything should be working (ha ha!). And we have a role list + edit functionality now. I'd like to merge this, if you approve, and work on smaller prs next. |
@artfulrobot Cool, yes, I think this is a more consistent schema. And I agree about preferring to merge. FWIW, I also spent some time playing around with it. You probably have a list of notes in your head for things to tackle, but (just in case it helps) here are some of the things that popped out at me:
|
Thanks @totten yes I'm aware about those.
|
@artfulrobot I'm not sure if "X" is a very good name for an afform... |
Good point! Someone might think we're leaning towards megalomania. I'll update that in my next standalone pr. |
... or a social network LOL |
@artfulrobot just wait until #27553 is merged or it will conflict. |
@artfulrobot ok merged! I would tweet about it but... you know... |
Small steps forward on providing a way to administer users, roles.
This PR provides a SK/FB for listing/editing users. It also reworks the entities for RBAC; moving from separate Role and UserRole entities to a compound roles field on User using a pseudoconstant.
Test updated.