1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Be more explicit with our user_admin_role selection to avoid potential future bugs

This commit is contained in:
Akita Noek 2016-04-16 18:32:34 -04:00
parent 849a9c08b0
commit a7f9eedb21

View File

@ -63,7 +63,10 @@ def register_access(model_class, access_class):
@property
def user_admin_role(self):
return Role.objects.get(content_type=ContentType.objects.get_for_model(User), object_id=self.id)
return Role.objects.get(
content_type=ContentType.objects.get_for_model(User),
object_id=self.id,
role_field='admin_role')
def user_accessible_objects(user, role_name):
return ResourceMixin._accessible_objects(User, user, role_name)