Fix for #4267 - allow admins to access all roles.
This commit is contained in:
parent
77f938b856
commit
8f7a8553bb
|
@ -146,8 +146,9 @@ exports.getRole = async roleId => {
|
||||||
* Simple function to get all the roles based on the top level user role ID.
|
* Simple function to get all the roles based on the top level user role ID.
|
||||||
*/
|
*/
|
||||||
async function getAllUserRoles(userRoleId) {
|
async function getAllUserRoles(userRoleId) {
|
||||||
if (!userRoleId) {
|
// admins have access to all roles
|
||||||
return [BUILTIN_IDS.BASIC]
|
if (userRoleId === BUILTIN_IDS.ADMIN) {
|
||||||
|
return exports.getAllRoles()
|
||||||
}
|
}
|
||||||
let currentRole = await exports.getRole(userRoleId)
|
let currentRole = await exports.getRole(userRoleId)
|
||||||
let roles = currentRole ? [currentRole] : []
|
let roles = currentRole ? [currentRole] : []
|
||||||
|
|
Loading…
Reference in New Issue