mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Merge branch 'develop' into sabrecat/teams-rebase
This commit is contained in:
@@ -522,7 +522,11 @@ schema.methods.isAdmin = function isAdmin () {
|
||||
};
|
||||
|
||||
schema.methods.isNewsPoster = function isNewsPoster () {
|
||||
return Boolean(this.contributor && this.contributor.newsPoster);
|
||||
return this.hasPermission('news');
|
||||
};
|
||||
|
||||
schema.methods.hasPermission = function hasPermission (permission) {
|
||||
return Boolean(this.permissions && (this.permissions[permission] || this.permissions.fullAccess));
|
||||
};
|
||||
|
||||
// When converting to json add inbox messages from the Inbox collection
|
||||
|
||||
Reference in New Issue
Block a user