From 7720f1912afd41bc6b1634315ea13b7384a8f6e5 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 8 Feb 2024 11:05:13 -0500 Subject: [PATCH 1/3] feat(auth): add verb/noun access properties to Permission --- bento_lib/auth/permissions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bento_lib/auth/permissions.py b/bento_lib/auth/permissions.py index 54efb52..dbc34b4 100644 --- a/bento_lib/auth/permissions.py +++ b/bento_lib/auth/permissions.py @@ -72,6 +72,14 @@ def _str_form(cls, verb: PermissionVerb, noun: PermissionNoun) -> str: def __repr__(self): return f"Permission({str(self)})" + @property + def verb(self) -> PermissionVerb: + return self._verb + + @property + def noun(self) -> PermissionNoun: + return self._noun + @property def gives(self) -> frozenset["Permission"]: return self._gives From 00c3ce598f9583063025e213882ae831122c40ba Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 8 Feb 2024 11:05:53 -0500 Subject: [PATCH 2/3] test(auth): test verb/noun access props --- tests/test_auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_auth.py b/tests/test_auth.py index d26e832..5f90845 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -29,6 +29,8 @@ def test_permissions_equality(): assert P_QUERY_DATA != P_DELETE_DATA assert P_QUERY_DATA != "a" assert P_QUERY_DATA != 5 + assert P_QUERY_DATA.verb == QUERY_VERB + assert P_QUERY_DATA.noun == DATA def test_permissions_repr(): From eeab52545af4e421b5e6321eba6f824228d7c46e Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 8 Feb 2024 11:14:03 -0500 Subject: [PATCH 3/3] chore: bump version to 11.5.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4c928c0..5421c5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bento-lib" -version = "11.4.1" +version = "11.5.0" description = "A set of common utilities and helpers for Bento platform services." authors = [ "David Lougheed ",