MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / has_permission

Method has_permission

api/audit/permissions.py:22–29  ·  view source on GitHub ↗
(self, request: Request, view: View)

Source from the content-addressed store, hash-verified

20
21class ProjectAuditLogPermissions(BasePermission):
22 def has_permission(self, request: Request, view: View): # type: ignore[no-untyped-def]
23 try:
24 project_id = view.kwargs["project_pk"]
25 project = Project.objects.get(id=project_id)
26 except (Project.DoesNotExist, KeyError):
27 return False
28
29 return request.user.has_project_permission(VIEW_AUDIT_LOG, project) # type: ignore[union-attr]

Calls 2

getMethod · 0.45