drf-iam 0.2.8__py3-none-any.whl → 0.2.10__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.
@@ -85,7 +85,9 @@ class PermissionLoader:
85
85
  elif isinstance(pattern, URLPattern):
86
86
  callback = pattern.callback
87
87
  viewset_class = getattr(callback, 'cls', None)
88
- if is_viewset(viewset_class) or is_api_view(viewset_class):
88
+ if (is_viewset(viewset_class) or is_api_view(viewset_class)) and getattr(viewset_class,
89
+ "drf_iam_exclude_from_permissions",
90
+ True):
89
91
  yield {
90
92
  'prefix': prefix,
91
93
  'pattern': pattern.pattern,
@@ -262,10 +264,10 @@ class PermissionLoader:
262
264
  to_update: List[PolicyDetail] = []
263
265
  current_map_for_update = {(p.action, p.resource_type): p for p in self.current_db_policies}
264
266
 
265
- for desired_policy in desired_set & current_set:
267
+ for desired_policy in current_set & desired_set:
266
268
  current_policy_match = current_map_for_update.get((desired_policy.action, desired_policy.resource_type))
267
269
  if current_policy_match and (
268
- current_policy_match.policy_name != desired_policy.policy_name or \
270
+ current_policy_match.policy_name != desired_policy.policy_name or
269
271
  current_policy_match.description != desired_policy.description
270
272
  ):
271
273
  to_update.append(PolicyDetail(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drf-iam
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: IAM-style roles and permissions for Django Rest Framework
5
5
  Home-page: https://github.com/tushar1328/drf-iam.git
6
6
  Author: Tushar Patel
@@ -9,9 +9,9 @@ drf_iam/migrations/0001_initial.py,sha256=y_4jXnr7gjU4UXxVrgVrStTSFu3h1ZrmjEZDL4
9
9
  drf_iam/migrations/0002_add_policy_name.py,sha256=EUZ2OCmobOlmnlpYv0jsMBb3QR0HknW4qAjgn-zOzA0,353
10
10
  drf_iam/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  drf_iam/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- drf_iam/utils/load_viewset_permissions.py,sha256=HtEQqZ48NOtYtpyDNLg0eMJFkdImkEaq8YEMADD0I_c,15099
12
+ drf_iam/utils/load_viewset_permissions.py,sha256=IN4V7hJxzFZWQTugS9ZgOS9vRJl3qvQnpJ-Hyf92Gbw,15346
13
13
  drf_iam/utils/logging_utils.py,sha256=9I9hhSVgOVW5xdKXSKofbjgl6rMYbmAI40euiB5WNlM,2074
14
- drf_iam-0.2.8.dist-info/METADATA,sha256=EUbV0JxfcIP6MI_CXjhbes7tR8euXBmzV8rapZgIWBA,2763
15
- drf_iam-0.2.8.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
16
- drf_iam-0.2.8.dist-info/top_level.txt,sha256=daz6AaQ9e_cfCjLk2aRoLb_PCOoFofYUX4DU85VwHSM,8
17
- drf_iam-0.2.8.dist-info/RECORD,,
14
+ drf_iam-0.2.10.dist-info/METADATA,sha256=e1628A74BsFYv_Fd62RySOwbpeKSJv2dHbZO5kBfMsI,2764
15
+ drf_iam-0.2.10.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
16
+ drf_iam-0.2.10.dist-info/top_level.txt,sha256=daz6AaQ9e_cfCjLk2aRoLb_PCOoFofYUX4DU85VwHSM,8
17
+ drf_iam-0.2.10.dist-info/RECORD,,