Skip to content

Commit

Permalink
fix permission bug
Browse files Browse the repository at this point in the history
  • Loading branch information
willronchetti committed Aug 11, 2023
1 parent 9622440 commit ff5e646
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ snovault
Change Log
----------

10.0.2
======

* Repair bug in ``permission`` implementation involving restricted fields


10.0.1
======

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicsnovault"
version = "10.0.1"
version = "10.0.2"
description = "Storage support for 4DN Data Portals."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 5 additions & 1 deletion snovault/schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ class IgnoreUnchanged(ValidationError):
pass


class SnoPermissionError(ValidationError):
pass


def requestMethod(validator, requestMethod, instance, schema):
ignored(instance, schema)
if validator.is_type(requestMethod, "string"):
Expand All @@ -300,7 +304,7 @@ def permission(validator, permission, instance, schema):
context = request.context
if not request.has_permission(permission, context):
error = "permission %r required" % permission
yield IgnoreUnchanged(error)
yield SnoPermissionError(error)


VALIDATOR_REGISTRY = {}
Expand Down

0 comments on commit ff5e646

Please sign in to comment.