mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 01:07:03 +08:00
Merge branch 'master' into sory-139595043-qbox
This commit is contained in:
+7
-1
@@ -154,7 +154,9 @@ const USER_GRAPH_OPERATIONS = [
|
||||
'mutation:createComment',
|
||||
'mutation:createAction',
|
||||
'mutation:deleteAction',
|
||||
'mutation:editName'
|
||||
'mutation:editName',
|
||||
'mutation:setUserStatus',
|
||||
'mutation:setCommentStatus'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -170,6 +172,10 @@ UserSchema.method('can', function(...actions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (actions.some((action) => action === 'mutation:setUserStatus' || action === 'mutation:setCommentStatus') && !this.hasRoles('ADMIN')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user