コード例 #1
0
 def has_object_perm(self, auth, user, obj, method='GET'):
     perm = OrganizationPermission()
     request = Mock()
     request.auth = auth
     request.user = user
     request.method = method
     return perm.has_object_permission(request, None, obj)
コード例 #2
0
ファイル: test_organization.py プロジェクト: Batterfii/sentry
 def has_object_perm(self, auth, user, obj, method="GET"):
     perm = OrganizationPermission()
     request = Mock()
     request.auth = auth
     request.user = user
     request.method = method
     return perm.has_object_permission(request, None, obj)
コード例 #3
0
ファイル: test_organization.py プロジェクト: yaoqi/sentry
 def has_object_perm(self, method, obj, auth=None, user=None, is_superuser=None):
     perm = OrganizationPermission()
     request = self.make_request(user=user, auth=auth, method=method)
     if is_superuser:
         request.superuser.set_logged_in(request.user)
     return (
         perm.has_permission(request, None) and perm.has_object_permission(request, None, obj)
     )
コード例 #4
0
ファイル: test_organization.py プロジェクト: ycaihua/sentry-1
 def has_object_perm(self, method, obj, auth=None, user=None, is_superuser=None):
     perm = OrganizationPermission()
     request = Mock()
     request.auth = auth
     request.user = user
     request.method = method
     request.is_superuser = lambda: is_superuser if is_superuser is not None else user.is_superuser
     return perm.has_object_permission(request, None, obj)
コード例 #5
0
 def has_object_perm(self, method, obj, auth=None, user=None, is_superuser=None):
     perm = OrganizationPermission()
     request = self.make_request(user=user, auth=auth, method=method)
     if is_superuser:
         request.superuser.set_logged_in(request.user)
     return (
         perm.has_permission(request, None) and perm.has_object_permission(request, None, obj)
     )