Policies refactor, guest roles (#6732)
This commit is contained in:
@@ -79,6 +79,13 @@ class User extends ParanoidModel {
|
||||
return this.role === UserRole.Admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user is a member (editor).
|
||||
*/
|
||||
get isMember(): boolean {
|
||||
return this.role === UserRole.Member;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user is a viewer.
|
||||
*/
|
||||
@@ -86,6 +93,13 @@ class User extends ParanoidModel {
|
||||
return this.role === UserRole.Viewer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user is a guest.
|
||||
*/
|
||||
get isGuest(): boolean {
|
||||
return this.role === UserRole.Guest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user has been recently active. Recently is currently defined
|
||||
* as within the last 5 minutes.
|
||||
|
||||
Reference in New Issue
Block a user