Allow users to have multiple roles
C
Cat
Hello Max!
When I was editing a user's role today I realized it wasn't possible for someone to have more than one role at a time, yet I believe this is something we used to have.
For example, if a VIP Member is also a Contributor, so they can edit and add stuff as other contibutors/editors do but still keep their VIP privileges as a "VIP Member."
We were wondering if it's possible to be able to rectify this?
Hopefully this makes sense. Let me know if you need any more explanation!
C
Cat
Max Romanchenko A minor request if it's possible! :)
Max Romanchenko
Cat Hi Cat,
Thanks for asking about this!
You're right, that was possible with our old system, but it was actually a bit of a headache behind the scenes. When Duong and I were planning the migration, we decided to simplify things by giving each user just one role. It keeps the user list clean and makes it super easy to see who's who.
For your VIP who needs to contribute: the easiest fix is to just change their role to Contributor. A Contributor gets all the same VIP perks - no ads and unlimited downloads, plus they can create and edit their own posts. It's basically a VIP who can also publish content.
Here's a link to the role definitions:
https://drama-otaku.com/help/user-roles-and-definitions/
Hope that helps! Let me know if you have any other questions.
Amrayu78
Max Romanchenko Hi Max, is it possible to keep a history of a user's role then?
Maybe add this to Spyglass so we can keep track of little things like this?
Thanks.
Max Romanchenko
Amrayu78 Hi Duong,
That's definitely possible, and I'm happy to let you know it's already implemented.
It automatically records every role change with a timestamp. This logging happens in several key moments:
- During user registration
- When a profile is edited (admin panel)
- When a subscription is purchased or expires (the role is upgraded or downgraded).
This data is now being tracked and will be available in Spyglass. Please check it.
Amrayu78
Max Romanchenko Thanks for adding this! I suspect that this can get long? If a user keeps subscribing to different tiers.
Can we move it into a separate tab next to Flags underneath?
If possible, can we as admin add notes for role changes? This will help us keep a clear log of what is happening.
Also one more minor update to the roles above, can we add a tag for "Flags" -- basically show all users who have flags. This is useful for us to go back and check which users have been flagged.
Max Romanchenko
Amrayu78 I previously mentioned that registration is logged, but that was a mistake - history should only track actual role changes (1. When a profile is edited 2.When a subscription is purchased or expires)
Can we move it into a separate tab next to Flags underneath?
– Done.
Also one more minor update to the roles above, can we add a tag for "Flags" -- basically show all users who have flags. This is useful for us to go back and check which users have been flagged.
– Done.
If possible, can we as admin add notes for role changes? This will help us keep a clear log of what is happening.
– I'm working on it
Max Romanchenko
Quick question - do you want the role history to save only the new role, or both the previous role and the new one for each change?
Current format:
[
'date' => 1234567890,
'role' => 'matey',
'note' => ''
]
Optional extended format (if you prefer more detail):
[
'date' => 1234567890,
'old' => 'customer',
'new' => 'matey',
'note' => ''
]
Amrayu78
Max Romanchenko let’s go with both old and new.
Max Romanchenko
Amrayu78 I'm done with this task. Please check it.
Amrayu78
Max Romanchenko I just tested this and it's not working.
User: questintheskies
Originally Contributor, changed to VIP, no record logged.
Changed back to Contributor, no recorded logged.
Max Romanchenko
Amrayu78 I think you changed roles through "Bulk actions," right?
This is not currently supported, but I am working on it.
Can you confirm that logging works if you change the role by editing the user?
Thank you.
Amrayu78
Max Romanchenko Yup, I'm changing through bulk changes, which is what I normally do. It saves me extra clicks versus having to go into their profile.
Amrayu78
Max Romanchenko Okay, I've edited via editing the user and that works.
Max Romanchenko
Amrayu78 Thanks for confirming. I've used improved logic and now this solution supports both scenarios - bulk editing and editing via user profile. I've tested it and it works. Please check it out when you get a chance.