diff options
| author | Hunternif <hunternif@gmail.com> | 2025-02-15 23:55:21 +0000 |
|---|---|---|
| committer | Hunternif <hunternif@gmail.com> | 2025-02-16 01:21:59 +0000 |
| commit | 778db7d510ccb7d772d4ed6677325f784ed96f0b (patch) | |
| tree | 3f2f8a73285913d2885b1e8266e211f44adc29c9 /server/szurubooru/api | |
| parent | 376f687c386f65522b2f65e98b998b21af26ee29 (diff) | |
server: add privilege posts:view:unsafe
Diffstat (limited to 'server/szurubooru/api')
| -rw-r--r-- | server/szurubooru/api/post_api.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index daba7f7..7883f5e 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -114,6 +114,8 @@ def create_snapshots_for_post( def get_post(ctx: rest.Context, params: Dict[str, str]) -> rest.Response: auth.verify_privilege(ctx.user, "posts:view") post = _get_post(params) + if post.safety == model.Post.SAFETY_UNSAFE: + auth.verify_privilege(ctx.user, "posts:view:unsafe") return _serialize_post(ctx, post) |