Create new user_roles system where you can assign custom roles to a user

Bug #1855383 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Robert Lyon

Bug Description

This will allow one to create a module where they can assign a custom role to a user and have the system do custom things for that role

Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → Wishlist
status: New → In Progress
milestone: none → 20.04.0
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10647

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/10679

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10647
Committed: https://git.mahara.org/mahara/mahara/commit/5e4899cf11cb80fb155b815b958978155778bddc
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 5e4899cf11cb80fb155b815b958978155778bddc
Author: Robert Lyon <email address hidden>
Date: Fri Dec 6 18:10:39 2019 +1300

Bug 1855383: Adding the framework for custom user roles

This patch deals with creating the new profile field class for userroles
and the db table to hold the roles so that we can see the roles listed
against the user when they exist

Also begins the UserRole class to set/unset roles

behatnotneeded

Change-Id: I7b14be1bed97cd470da5f03519597d1679532f3b
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :

For isolated institutions:

We need a way to say if we want to add the user to all groups on the site or only to the groups that belong to the same institution. This can be a switch displayed just below the autogroupadmin field. The switch label text: "Add to all groups on the site":

there are 3 scenarios:

For all scenarios UserA has the autogroupadmin role on the idp.

When isolated institutions is on:
1. The switch is disabled. UserA will be added as an admin to all the groups in the same institution.

When isolated institutions is off, the switch is enabled and the default is "off":
2. If the switch is on, UserA will be added as an admin to all groups of the site.
3. if the switch is off, User A will be added as an admin to all groups that belong to the institution of the user.

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :

other scenarios to test:

Auto group admin role

when
- a user is logged in by idp
- the saml auth instance for that idp has the auto group admin role set up
- the user has a role set up in the idp that matches the auto group admin role from the auth instance

then
- If the user doesn't exist on the site, the user gets added to all the groups on the site as a group admin

- If the user exists on the site, checks that the user exists in all the groups on the site as an admin. If there is any group where theuser is not part of or is a member but not admin, then the user gets added or the role changed to admin.

- It a new group is created in the site, then all the users that have a autogroupadmin role will be added to that group as an admin.

- If the role is removed from the user at the idp, then the next time the users logs in through the idp, the user gets removed from the groups.

- If a group admin is added by this feature, then no other user can remove them from the groups or change their admin role, not even site admin.

- If a user is removed from the site, it will be removed from the groups. This is how it works in master already. But next time the users logs in it will be created and added to the groups again, if the auth instance allows auto create users.

- The users added as group admins by this feature will be subscribed to forums but will not be able to unsubscribe

Changed in mahara:
status: Fix Committed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10679
Committed: https://git.mahara.org/mahara/mahara/commit/0cf441f3ee149393f8006c9a0076f76f55d6d80c
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 0cf441f3ee149393f8006c9a0076f76f55d6d80c
Author: Robert Lyon <email address hidden>
Date: Tue Dec 17 08:50:03 2019 +1300

Bug 1855383: Adding in autogroupadmin user role

behatnotneeded

Change-Id: I90b352ee72190783baf1b7aac90c606e83c00042
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
tags: added: nominatedfeature
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.