]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/auth/auth-user.model.ts
Breaking API: Consistency with role id/label
[github/Chocobozzz/PeerTube.git] / client / src / app / core / auth / auth-user.model.ts
index a1232542191fd33a7aad9ad43c4e45724355728e..2260752653820f950518db0b83e63545f69abbcd 100644 (file)
@@ -43,16 +43,16 @@ export class AuthUser extends User implements ServerMyUserModel {
   }
 
   hasRight (right: UserRight) {
-    return hasUserRight(this.role, right)
+    return hasUserRight(this.role.id, right)
   }
 
   canManage (user: ServerUserModel) {
-    const myRole = this.role
+    const myRole = this.role.id
 
     if (myRole === UserRole.ADMINISTRATOR) return true
 
     // I'm a moderator: I can only manage users
-    return user.role === UserRole.USER
+    return user.role.id === UserRole.USER
   }
 
   computeCanSeeVideosLink (quotaObservable: Observable<UserVideoQuota>): Observable<boolean> {