nlbone 0.7.27__py3-none-any.whl → 0.7.28__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ from nlbone.adapters.auth import KeycloakAuthService
4
4
  from nlbone.interfaces.api.exceptions import ForbiddenException, UnauthorizedException
5
5
  from nlbone.utils.context import current_request
6
6
 
7
- from .auth import client_has_access_func
7
+ from .auth import client_has_access_func, client_or_user_has_access_func
8
8
 
9
9
 
10
10
  async def current_user_id() -> int:
@@ -58,3 +58,15 @@ def has_access(*, permissions=None):
58
58
  return wrapper
59
59
 
60
60
  return decorator
61
+
62
+ def client_or_user_has_access(*, permissions=None, client_permissions=None):
63
+ def decorator(func):
64
+ @functools.wraps(func)
65
+ async def wrapper(*args, **kwargs):
66
+ client_or_user_has_access_func(permissions=permissions, client_permissions=client_permissions)
67
+ return await func(*args, **kwargs)
68
+
69
+ return wrapper
70
+
71
+ return decorator
72
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nlbone
3
- Version: 0.7.27
3
+ Version: 0.7.28
4
4
  Summary: Backbone package for interfaces and infrastructure in Python projects
5
5
  Author-email: Amir Hosein Kahkbazzadeh <a.khakbazzadeh@gmail.com>
6
6
  License: MIT
@@ -81,7 +81,7 @@ nlbone/interfaces/api/additional_filed/resolver.py,sha256=jv1TIBBHN4LBIMwHGipcy4
81
81
  nlbone/interfaces/api/additional_filed/default_field_rules/__init__.py,sha256=LUSAOO3xRUt5ptlraIx7H-7dSkdr1D-WprmnqXRB16g,48
82
82
  nlbone/interfaces/api/additional_filed/default_field_rules/image_field_rules.py,sha256=ecKqPeXZ-YiF14RK9PmK7ln3PCzpCUc18S5zm5IF3fw,339
83
83
  nlbone/interfaces/api/dependencies/__init__.py,sha256=rnYRrFVZCfICQrp_PVFlzNg3BeC57yM08wn2DbOHCfk,359
84
- nlbone/interfaces/api/dependencies/async_auth.py,sha256=s8qbMWuvHkS_9xnOmoO5kLLfKrZrOkvhKFfS9kQb51Y,1711
84
+ nlbone/interfaces/api/dependencies/async_auth.py,sha256=uQV36yk7s7SVsnwuA3eZ2NfqqVOe0vPFOSLuZcVsS8s,2122
85
85
  nlbone/interfaces/api/dependencies/auth.py,sha256=GGhXTUG0J_VHOjsQTBFpxHQV1OvT6RIGo2Jvj9IwQ6E,3310
86
86
  nlbone/interfaces/api/dependencies/client_credential.py,sha256=Bo4dYx75Qw0JzTKD9ZfV5EXDEOuwndJk2D-V37K2ePg,1293
87
87
  nlbone/interfaces/api/dependencies/db.py,sha256=-UD39J_86UU7ZJs2ZncpdND0yhAG0NeeeALrgSDuuFw,466
@@ -114,8 +114,8 @@ nlbone/utils/http.py,sha256=0yeI34j5FfelqvX3PJnKknSXji1jl15VYbVIIvrSbXg,997
114
114
  nlbone/utils/normalize_mobile.py,sha256=sGH4tV9gX-6eVKozviNWJhm1DN1J28Nj-ERldCYkS_E,732
115
115
  nlbone/utils/redactor.py,sha256=-V4HrHmHwPi3Kez587Ek1uJlgK35qGSrwBOvcbw8Jas,1279
116
116
  nlbone/utils/time.py,sha256=DjjyQ9GLsfXoT6NK8RDW2rOlJg3e6sF04Jw6PBUrSvg,1268
117
- nlbone-0.7.27.dist-info/METADATA,sha256=SsvEG_znVKNmDDWIElrPipFoXoaswe4MeINGKg5PcwA,2295
118
- nlbone-0.7.27.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
119
- nlbone-0.7.27.dist-info/entry_points.txt,sha256=CpIL45t5nbhl1dGQPhfIIDfqqak3teK0SxPGBBr7YCk,59
120
- nlbone-0.7.27.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
- nlbone-0.7.27.dist-info/RECORD,,
117
+ nlbone-0.7.28.dist-info/METADATA,sha256=px1B_Kvd923agUHScPD1lRerGtdjdMVsrHbCZKv5OiI,2295
118
+ nlbone-0.7.28.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
119
+ nlbone-0.7.28.dist-info/entry_points.txt,sha256=CpIL45t5nbhl1dGQPhfIIDfqqak3teK0SxPGBBr7YCk,59
120
+ nlbone-0.7.28.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
+ nlbone-0.7.28.dist-info/RECORD,,