update backend with the can() method

This commit is contained in:
riley
2017-05-16 10:50:09 -06:00
parent 62e8e4c5c5
commit c7e9fe3f5f
10 changed files with 34 additions and 122 deletions
+4 -4
View File
@@ -236,19 +236,19 @@ module.exports = (context) => {
}
};
if (context.user && context.user.can('mutation:createComment')) {
if (context.user && context.user.can('CREATE_COMMENT')) {
mutators.Comment.create = (comment) => createPublicComment(context, comment);
}
if (context.user && context.user.can('mutation:setCommentStatus')) {
if (context.user && context.user.can('SET_COMMENT_STATUS')) {
mutators.Comment.setCommentStatus = (action) => setCommentStatus(context, action);
}
if (context.user && context.user.can('mutation:addCommentTag')) {
if (context.user && context.user.can('ADD_COMMENT_TAG')) {
mutators.Comment.addCommentTag = (action) => addCommentTag(context, action);
}
if (context.user && context.user.can('mutation:removeCommentTag')) {
if (context.user && context.user.can('REMOVE_COMMENT_TAG')) {
mutators.Comment.removeCommentTag = (action) => removeCommentTag(context, action);
}