##// END OF EJS Templates
added permission overview into users group
marcink -
r3861:c74eaaae beta
parent child Browse files
Show More
@@ -66,6 +66,10 b' class UsersGroupsController(BaseControll'
66 c.available_permissions = config['available_permissions']
66 c.available_permissions = config['available_permissions']
67
67
68 def __load_data(self, user_group_id):
68 def __load_data(self, user_group_id):
69 permissions = {
70 'repositories': {},
71 'repositories_groups': {}
72 }
69 ugroup_repo_perms = UserGroupRepoToPerm.query()\
73 ugroup_repo_perms = UserGroupRepoToPerm.query()\
70 .options(joinedload(UserGroupRepoToPerm.permission))\
74 .options(joinedload(UserGroupRepoToPerm.permission))\
71 .options(joinedload(UserGroupRepoToPerm.repository))\
75 .options(joinedload(UserGroupRepoToPerm.repository))\
@@ -73,7 +77,7 b' class UsersGroupsController(BaseControll'
73 .all()
77 .all()
74
78
75 for gr in ugroup_repo_perms:
79 for gr in ugroup_repo_perms:
76 c.users_group.permissions['repositories'][gr.repository.repo_name] \
80 permissions['repositories'][gr.repository.repo_name] \
77 = gr.permission.permission_name
81 = gr.permission.permission_name
78
82
79 ugroup_group_perms = UserGroupRepoGroupToPerm.query()\
83 ugroup_group_perms = UserGroupRepoGroupToPerm.query()\
@@ -83,9 +87,9 b' class UsersGroupsController(BaseControll'
83 .all()
87 .all()
84
88
85 for gr in ugroup_group_perms:
89 for gr in ugroup_group_perms:
86 c.users_group.permissions['repositories_groups'][gr.group.group_name] \
90 permissions['repositories_groups'][gr.group.group_name] \
87 = gr.permission.permission_name
91 = gr.permission.permission_name
88
92 c.permissions = permissions
89 c.group_members_obj = sorted((x.user for x in c.users_group.members),
93 c.group_members_obj = sorted((x.user for x in c.users_group.members),
90 key=lambda u: u.username.lower())
94 key=lambda u: u.username.lower())
91
95
@@ -118,9 +118,13 b''
118 </div>
118 </div>
119 <%namespace name="dpb" file="/base/default_perms_box.html"/>
119 <%namespace name="dpb" file="/base/default_perms_box.html"/>
120 ${dpb.default_perms_box(url('users_group_perm', id=c.users_group.users_group_id))}
120 ${dpb.default_perms_box(url('users_group_perm', id=c.users_group.users_group_id))}
121
122 ## permissions overview
123 <%namespace name="p" file="/base/perms_summary.html"/>
124 ${p.perms_summary(c.permissions)}
121 </div>
125 </div>
122
126
123 <div class="box box-right">
127 <div class="box box-right" style="clear:right">
124 <div class="title">
128 <div class="title">
125 <h5>${_('Permissions')}</h5>
129 <h5>${_('Permissions')}</h5>
126 </div>
130 </div>
General Comments 0
You need to be logged in to leave comments. Login now