If you’re reading this and you are not an extension and/or bot developer, this will most likely not apply to you and it’s not important for you to read this. if you do maintain any code that uses plug.dj, please read this to make sure your permissions don’t go all crazy on you..
You might have already heard, we are planning to add new roles to plug.dj. Right now, there is no space to squeeze a role into. We have constants for the current roles from 0 to 5 in ascending order.
1: “(Resident) DJ”,
3: “Brand Ambassador”,
The same goes for our global roles (Brand Ambassador, Admin). If you use code to check for BAs/Admins you might have come across the gRole property. This stands for global role. You’ll know that for a Brand Ambassador, the gRole property is set to 3 and for an Admin it’s 5. This essentially means that a Brand Ambassador has the permissions of a Manager globally (in every community) and Admin has Host everywhere on the site.
Chances are in both our code and your code you will compare these roles by using the constants to compare permissions. For example, if the role is higher or equal to 2 (Bouncer), you let a user perform a certain action (eg. ban via your bot). If we would add another role, we’d have to add role 6. This would mean that they would have the most permissions out of every role that exists.
We decided to multiply all existing roles by 1000. The new scheme will look like this:
1000: “(Resident) DJ”,
3000: “Brand Ambassador”,
This means we have room for 999 other roles in between the current roles that we have. This allows for much more flexibility and not very much code change for you and me.
Please email firstname.lastname@example.org if this update is manageable for you to be prepared for your bots and extensions/scripts before Tuesday, September 19th or if you’d like to be added to our developer mailing list.