mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Simplify some auth code, add a FIXME
This commit is contained in:
parent
8b698d13d0
commit
e405c9b746
@ -49,14 +49,11 @@ class CommonModel(models.Model):
|
||||
if not sub_obj.can_user_read(user, sub_obj):
|
||||
return False
|
||||
return cls.can_user_administrate(user, obj)
|
||||
else:
|
||||
raise Exception("unknown relationship type: %s" % relationship)
|
||||
return False
|
||||
raise Exception("unknown relationship type: %s" % relationship)
|
||||
|
||||
@classmethod
|
||||
def can_user_unattach(cls, user, obj, relationship):
|
||||
return cls.can_user_attach(user, obj, relationship)
|
||||
|
||||
return cls.can_user_administrate(user, obj)
|
||||
|
||||
class Tag(models.Model):
|
||||
'''
|
||||
|
||||
@ -298,7 +298,8 @@ class OrganizationsTest(BaseTest):
|
||||
self.post(projects7_url, a_project, expect=204, auth=self.get_super_credentials())
|
||||
projects7 = self.get(projects7_url, expect=200, auth=self.get_super_credentials())
|
||||
self.assertEquals(projects7['count'], 5)
|
||||
|
||||
|
||||
# FIXME: need to add tests for associating and disassocating from a non-priveledged acct
|
||||
|
||||
def test_post_item_subobjects_users(self):
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user