コード例 #1
0
 def delete_list(self, object_list, bundle):
     raise Unauthorized("Deletes not allowed")
コード例 #2
0
 def obj_delete_list(self, bundle, **kwargs):
     raise Unauthorized('Não permitido.')
コード例 #3
0
ファイル: api.py プロジェクト: dirkvandelindt/snipt
 def create_detail(self, object_list, bundle):
     raise Unauthorized()
コード例 #4
0
ファイル: auth.py プロジェクト: ncc-unesp/goo-server
 def delete_detail(self, object_list, bundle):
     raise Unauthorized("Sorry, no deletes.")
コード例 #5
0
 def delete_list(self, object_list, bundle):
     raise Unauthorized('You cannot perform this action')
コード例 #6
0
 def create_list(self, object_list, bundle):
     # Assuming their auto-assigned to ``user``.
     raise Unauthorized("Not yet implemented.")
コード例 #7
0
 def delete_list(self, object_list, bundle):
     # Sorry user, no deletes for you!
     raise Unauthorized("Not yet implemented.")
コード例 #8
0
ファイル: api_auth.py プロジェクト: smagowr/ralph
 def authorized(self, user):
     user = User.objects.get(username=user.username).get_profile()
     for perm in self.required_perms:
         if not user.has_perm(perm):
             raise Unauthorized(NO_ACCESS_MSG)
     return True
コード例 #9
0
 def update_detail(self, object_list, bundle):
     dbg_print('update_detail')
     return Unauthorized("Can't update detail yet")
コード例 #10
0
 def delete_detail(self, object_list, bundle):
     if not bundle.request.user.is_anonymous():
         if int(bundle.obj.user_id.id) == int(bundle.request.user.id):
             return True
     raise Unauthorized("You are not allowed to access that resource.")
コード例 #11
0
 def update_detail(self, object_list, bundle):
     if int(bundle.obj.id) == bundle.request.user.id:
         return True
     raise Unauthorized("You are not allowed to access that resource.")
コード例 #12
0
 def read_detail(self, object_list, bundle):
     if int(bundle.obj.user_id) in self.get_timeline(bundle=bundle):
         return True
     raise Unauthorized("You are not allowed to access that resource.")
コード例 #13
0
 def delete_detail(self, object_list, bundle):
     if bundle.obj.id == bundle.request.user.id or bundle.request.user.is_superuser:
         return True
     else:
         raise Unauthorized('Not yours data')
コード例 #14
0
 def delete_detail(self, object_list, bundle):
     if bundle.obj.owner == bundle.request.user:
         return True
     else:
         raise Unauthorized("Deletes not allowed")
コード例 #15
0
 def delete_detail(self, object_list, bundle):
     raise Unauthorized("You are not allowed to access that resource.")
コード例 #16
0
 def delete_list(self, object_list, bundle):
     dbg_print('delete_list')
     return Unauthorized("Can't delete list yet")
コード例 #17
0
ファイル: api.py プロジェクト: lacoperon/wescam-2016
 def delete_list(self, object_list, bundle):
     # Sorry user, no deletes for you!
     raise Unauthorized("Sorry, no deletes.")
コード例 #18
0
 def delete_detail(self, object_list, bundle):
     dbg_print('delete_detail')
     return Unauthorized("Can't delete detail yet")
コード例 #19
0
 def update_list(self, object_list, bundle):
     raise Unauthorized("Not yet implemented.")
コード例 #20
0
 def update_list(self, object_list, bundle):
     dbg_print('update_list')
     return Unauthorized("Can't update list yet")
コード例 #21
0
 def delete_detail(self, object_list, bundle):
     raise Unauthorized("Not yet implemented.")
コード例 #22
0
 def check_detail(self, object_list, bundle, perm):
     user = self.get_pony_user(bundle)
     if not self.get_pony_hasperm_model(user, perm, object_list._origin):
         raise Unauthorized("You are not allowed to access that resource.")
     return True
コード例 #23
0
 def obj_delete_list(self,bundle,**kwargs):
     raise Unauthorized('exclusao de lista não permetido')
コード例 #24
0
ファイル: api.py プロジェクト: UWA-FoS/trudat
 def delete_detail(self, object_list, bundle):
     if isinstance(bundle.obj, Experiment):
         return bundle.request.user.has_perm(
             'tardis_portal.change_experiment') and \
             has_delete_permissions(bundle.request, bundle.obj.id)
     raise Unauthorized("Sorry, no deletes.")
コード例 #25
0
 def api_key_is_valid(self, bundle):
     api_key = bundle.request.GET.get('api_key', None)
     if api_key and api_key == settings.API_KEY:
         return True
     else:
         raise Unauthorized('Missing api key')
コード例 #26
0
    def generic_list_check(self, object_list, bundle):
        if not self.generic_base_check(object_list, bundle):
            raise Unauthorized("You are not allowed to access that resource.")

        return object_list.filter(pk=bundle.request.user.id)
コード例 #27
0
ファイル: api.py プロジェクト: dirkvandelindt/snipt
 def read_list(self, object_list, bundle):
     raise Unauthorized()
コード例 #28
0
 def dispatch_likes(self, request, **kwargs):
     if request.user.id is None:
         raise Unauthorized(
             "You are not authorized to like Pins unless you are logged in")
     return LikeResource().dispatch('list', request, **kwargs)
コード例 #29
0
ファイル: api.py プロジェクト: dirkvandelindt/snipt
 def update_list(self, object_list, bundle):
     raise Unauthorized()
コード例 #30
0
 def update_list(self, object_list, bundle):
     return Unauthorized("Not allowed")