@@ -106,23 +106,6 @@ export class JwtUser {
|
||||
this.refreshTokenCount = user.refreshTokenCount;
|
||||
this.uuid = user.uuid;
|
||||
this.profilePic = user.profilePic;
|
||||
this.permissions = this.getPermissions(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handels getting the permissions granted to this user (direct or indirect).
|
||||
* @param user User which's permissions shall be gotten.
|
||||
*/
|
||||
public getPermissions(user: User): string[] {
|
||||
let returnPermissions: string[] = new Array<string>();
|
||||
for (let permission of user.permissions) {
|
||||
returnPermissions.push(permission.toString());
|
||||
}
|
||||
for (let group of user.groups) {
|
||||
for (let permission of group.permissions) {
|
||||
returnPermissions.push(permission.toString());
|
||||
}
|
||||
}
|
||||
return Array.from(new Set(returnPermissions));
|
||||
this.permissions = user.allPermissions;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user