mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
Simplify some auth code, add a FIXME
This commit is contained in:
@@ -49,14 +49,11 @@ class CommonModel(models.Model):
|
|||||||
if not sub_obj.can_user_read(user, sub_obj):
|
if not sub_obj.can_user_read(user, sub_obj):
|
||||||
return False
|
return False
|
||||||
return cls.can_user_administrate(user, obj)
|
return cls.can_user_administrate(user, obj)
|
||||||
else:
|
raise Exception("unknown relationship type: %s" % relationship)
|
||||||
raise Exception("unknown relationship type: %s" % relationship)
|
|
||||||
return False
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def can_user_unattach(cls, user, obj, relationship):
|
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):
|
class Tag(models.Model):
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -298,7 +298,8 @@ class OrganizationsTest(BaseTest):
|
|||||||
self.post(projects7_url, a_project, expect=204, auth=self.get_super_credentials())
|
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())
|
projects7 = self.get(projects7_url, expect=200, auth=self.get_super_credentials())
|
||||||
self.assertEquals(projects7['count'], 5)
|
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):
|
def test_post_item_subobjects_users(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user