tabs.py (horizon-18.6.2) | : | tabs.py (horizon-18.6.3) | ||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
} | } | |||
class RoleAssignmentsTab(tabs.TableTab): | class RoleAssignmentsTab(tabs.TableTab): | |||
"""Role assignment of the user to domain/project.""" | """Role assignment of the user to domain/project.""" | |||
table_classes = (role_assignments_tables.RoleAssignmentsTable,) | table_classes = (role_assignments_tables.RoleAssignmentsTable,) | |||
name = _("Role assignments") | name = _("Role assignments") | |||
slug = "roleassignments" | slug = "roleassignments" | |||
template_name = "horizon/common/_detail_table.html" | template_name = "horizon/common/_detail_table.html" | |||
preload = False | preload = False | |||
def allowed(self, request): | ||||
return policy.check((("identity", "identity:list_role_assignments"),), | ||||
self.request) | ||||
def get_roleassignmentstable_data(self): | def get_roleassignmentstable_data(self): | |||
user = self.tab_group.kwargs['user'] | user = self.tab_group.kwargs['user'] | |||
role_assignments = [] | role_assignments = [] | |||
try: | try: | |||
# Get all the roles of the user | # Get all the roles of the user | |||
role_assignments = api.keystone.role_assignments_list( | role_assignments = api.keystone.role_assignments_list( | |||
self.request, user=user, include_subtree=False, | self.request, user=user, include_subtree=False, | |||
include_names=True) | include_names=True) | |||
skipping to change at line 135 | skipping to change at line 139 | |||
return role_assignments | return role_assignments | |||
class GroupsTab(tabs.TableTab): | class GroupsTab(tabs.TableTab): | |||
"""Groups of the user.""" | """Groups of the user.""" | |||
table_classes = (groups_tables.GroupsTable,) | table_classes = (groups_tables.GroupsTable,) | |||
name = _("Groups") | name = _("Groups") | |||
slug = "groups" | slug = "groups" | |||
template_name = "horizon/common/_detail_table.html" | template_name = "horizon/common/_detail_table.html" | |||
preload = False | preload = False | |||
def allowed(self, request): | ||||
return policy.check((("identity", "identity:list_groups"),), | ||||
self.request) | ||||
def get_groupstable_data(self): | def get_groupstable_data(self): | |||
user_groups = [] | user_groups = [] | |||
user = self.tab_group.kwargs['user'] | user = self.tab_group.kwargs['user'] | |||
try: | try: | |||
user_groups = api.keystone.group_list(self.request, user=user.id) | user_groups = api.keystone.group_list(self.request, user=user.id) | |||
except Exception: | except Exception: | |||
exceptions.handle(self.request, | exceptions.handle(self.request, | |||
_("Unable to display the groups of this user.")) | _("Unable to display the groups of this user.")) | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added |