diff --git a/server/szurubooru/api/comment_api.py b/server/szurubooru/api/comment_api.py index 6f5ee00..2d2dc9a 100644 --- a/server/szurubooru/api/comment_api.py +++ b/server/szurubooru/api/comment_api.py @@ -39,7 +39,7 @@ class CommentDetailApi(BaseApi): def put(self, ctx, comment_id): comment = comments.get_comment_by_id(comment_id) - infix = 'self' if ctx.user.user_id == comment.user_id else 'any' + infix = 'own' if ctx.user.user_id == comment.user_id else 'any' text = ctx.get_param_as_string('text', required=True) auth.verify_privilege(ctx.user, 'comments:edit:%s' % infix) comment.last_edit_time = datetime.datetime.now() @@ -49,7 +49,7 @@ class CommentDetailApi(BaseApi): def delete(self, ctx, comment_id): comment = comments.get_comment_by_id(comment_id) - infix = 'self' if ctx.user.user_id == comment.user_id else 'any' + infix = 'own' if ctx.user.user_id == comment.user_id else 'any' auth.verify_privilege(ctx.user, 'comments:delete:%s' % infix) ctx.session.delete(comment) ctx.session.commit() diff --git a/server/szurubooru/tests/api/test_comment_deleting.py b/server/szurubooru/tests/api/test_comment_deleting.py index ceec2e6..fe64328 100644 --- a/server/szurubooru/tests/api/test_comment_deleting.py +++ b/server/szurubooru/tests/api/test_comment_deleting.py @@ -7,7 +7,7 @@ from szurubooru.func import util, comments def test_ctx(config_injector, context_factory, user_factory, comment_factory): config_injector({ 'privileges': { - 'comments:delete:self': db.User.RANK_REGULAR, + 'comments:delete:own': db.User.RANK_REGULAR, 'comments:delete:any': db.User.RANK_MODERATOR, }, }) diff --git a/server/szurubooru/tests/api/test_comment_updating.py b/server/szurubooru/tests/api/test_comment_updating.py index 7582246..d52c8d5 100644 --- a/server/szurubooru/tests/api/test_comment_updating.py +++ b/server/szurubooru/tests/api/test_comment_updating.py @@ -10,7 +10,7 @@ def test_ctx( 'data_dir': str(tmpdir), 'data_url': 'http://example.com', 'privileges': { - 'comments:edit:self': db.User.RANK_REGULAR, + 'comments:edit:own': db.User.RANK_REGULAR, 'comments:edit:any': db.User.RANK_MODERATOR, 'users:edit:any:email': db.User.RANK_MODERATOR, },