exporting function to test
This commit is contained in:
parent
fa83c5d7a1
commit
696eea9f92
|
@ -55,7 +55,7 @@ export function levelToNumber(perm: PermissionLevel) {
|
||||||
* @param {string} userPermLevel The permission level of the user.
|
* @param {string} userPermLevel The permission level of the user.
|
||||||
* @return {string[]} All the permission levels this user is allowed to carry out.
|
* @return {string[]} All the permission levels this user is allowed to carry out.
|
||||||
*/
|
*/
|
||||||
function getAllowedLevels(userPermLevel: PermissionLevel) {
|
export function getAllowedLevels(userPermLevel: PermissionLevel): string[] {
|
||||||
switch (userPermLevel) {
|
switch (userPermLevel) {
|
||||||
case PermissionLevel.EXECUTE:
|
case PermissionLevel.EXECUTE:
|
||||||
return [PermissionLevel.EXECUTE]
|
return [PermissionLevel.EXECUTE]
|
||||||
|
@ -64,9 +64,9 @@ function getAllowedLevels(userPermLevel: PermissionLevel) {
|
||||||
case PermissionLevel.WRITE:
|
case PermissionLevel.WRITE:
|
||||||
case PermissionLevel.ADMIN:
|
case PermissionLevel.ADMIN:
|
||||||
return [
|
return [
|
||||||
|
PermissionLevel.EXECUTE,
|
||||||
PermissionLevel.READ,
|
PermissionLevel.READ,
|
||||||
PermissionLevel.WRITE,
|
PermissionLevel.WRITE,
|
||||||
PermissionLevel.EXECUTE,
|
|
||||||
]
|
]
|
||||||
default:
|
default:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue