File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ def is_no_entitled(request):
73
73
return no_auth
74
74
75
75
76
+ def is_no_access (request ):
77
+ """Check condition for user access."""
78
+ no_access_list = ["aws-s3-regions" ]
79
+ no_auth = any (no_auth_path in request .path for no_auth_path in no_access_list )
80
+ return no_auth
81
+
82
+
76
83
class HttpResponseUnauthorizedRequest (HttpResponse ):
77
84
"""A subclass of HttpResponse to return a 401.
78
85
Used if identity header is not sent.
@@ -190,6 +197,8 @@ def _check_user_has_access(self, request):
190
197
PermissionDenied: If the user does not have permissions for Cost Management.
191
198
192
199
"""
200
+ if is_no_access (request ):
201
+ return
193
202
if not request .user .admin and not request .user .access :
194
203
msg = f"User { request .user .username } does not have permissions for Cost Management."
195
204
LOG .warning (msg )
You can’t perform that action at this time.
0 commit comments