TromsFylkestrafikk / ragnarok

Harvest public transport data for statistics usage
0 stars 0 forks source link

Create UI for assigning roles to users #8

Closed tfk-kaare closed 8 months ago

tfk-kaare commented 1 year ago

For users with the right permission, create a UI for adding users to roles.

tfk-kaare commented 1 year ago

Nice work!

One big flaw, though: Users can be assigned several roles, not just one. I.e. the radio selector for user role must be converted to a checkbox-alike function.

Also, branch re-based on main post #11.

tfk-kaare commented 1 year ago

Aaaand, use PR when ready for better review tools.

I see some vars in e.g. Roles.vue that probably don't need to be reactive (const someVar = ref(...))

tft-kyrre commented 1 year ago

Is it really necessary to assign multiple roles to a single user in this application? Admins already have all available permissions and a "maintainer" already have permission to read sources. It would only make sense to assign multiple roles to a user if admins were limited to manage user accounts only (i.e. no reading, editing nor importing of sources) and likewise: a maintainer role would not be allowed to read any sources. Keeping the role and permission setup simple (as it is today) allows us to skip task #10 completely.

tfk-kaare commented 1 year ago

A site admin doesn't necessarily need the same privileges as an data lake admin. And as a concept, permissions is more logically assigned to roles to keep separation of concern, where in turn, users are given various roles depending on their place and knowledge.

We've just scratched the surface of what this application is supposed to do and have no final answer to what roles and permissions are required in the future.

Conceptually roles must be multi-selectable, but in order to keep momentum here I'll leave it as is. It's not a blocker for further application architecture, as the API still allows us to assign several roles. It's just not complete.

tfk-kaare commented 8 months ago

It's becoming apparent that we need multiple roles with different set of permissions, and that these permissions should be editable per role.

As the number of sinks becomes available and the sensitivity of this data needs to be granularized, there currently isn't any way to easily give some users read access to some sinks or columns.

By creating separate roles for each sink, or maybe groups of columns per sink, we can give these roles to the users that needs them, instead of creating new roles with a different set of permissions.

Yes. We need several roles per user, and the ability to assign them in UI.

tfk-kaare commented 8 months ago

Closing this, as the code provided already is committed.