##// END OF EJS Templates
permissions: show user group count in permissions summary, and unified some text labels.
marcink -
r3385:5a371ab1 default
parent child
Show More
@@ -462,8 +462,7 class RepoModel(BaseModel):
462 UserGroupRepoToPerm.create(
462 UserGroupRepoToPerm.create(
463 perm.users_group, new_repo, perm.permission)
463 perm.users_group, new_repo, perm.permission)
464 # in case we copy permissions and also set this repo to private
464 # in case we copy permissions and also set this repo to private
465 # override the default user permission to make it a private
465 # override the default user permission to make it a private repo
466 # repo
467 if private:
466 if private:
468 RepoModel(self.sa).grant_user_permission(
467 RepoModel(self.sa).grant_user_permission(
469 repo=new_repo, user=User.DEFAULT_USER, perm=EMPTY_PERM)
468 repo=new_repo, user=User.DEFAULT_USER, perm=EMPTY_PERM)
@@ -485,8 +484,7 class RepoModel(BaseModel):
485 perm_name = perm.permission.permission_name.replace(
484 perm_name = perm.permission.permission_name.replace(
486 'group.', 'repository.')
485 'group.', 'repository.')
487 perm_obj = Permission.get_by_key(perm_name)
486 perm_obj = Permission.get_by_key(perm_name)
488 UserGroupRepoToPerm.create(
487 UserGroupRepoToPerm.create(perm.users_group, new_repo, perm_obj)
489 perm.users_group, new_repo, perm_obj)
490
488
491 if private:
489 if private:
492 RepoModel(self.sa).grant_user_permission(
490 RepoModel(self.sa).grant_user_permission(
@@ -497,8 +495,7 class RepoModel(BaseModel):
497 self.sa.add(perm_obj)
495 self.sa.add(perm_obj)
498
496
499 # now automatically start following this repository as owner
497 # now automatically start following this repository as owner
500 ScmModel(self.sa).toggle_following_repo(new_repo.repo_id,
498 ScmModel(self.sa).toggle_following_repo(new_repo.repo_id, owner.user_id)
501 owner.user_id)
502
499
503 # we need to flush here, in order to check if database won't
500 # we need to flush here, in order to check if database won't
504 # throw any exceptions, create filesystem dirs at the very end
501 # throw any exceptions, create filesystem dirs at the very end
@@ -70,7 +70,7
70 </div>
70 </div>
71 <div class="checkboxes">
71 <div class="checkboxes">
72 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
72 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
73 <span class="help-block">${_('Copy permission settings from parent repository group.')}</span>
73 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
74 </div>
74 </div>
75 </div>
75 </div>
76
76
@@ -133,7 +133,7
133 %endfor
133 %endfor
134
134
135 ## USER GROUPS
135 ## USER GROUPS
136 %for _user_group in c.repo_group.permission_user_groups():
136 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
137 <tr id="id${id(_user_group.users_group_name)}">
137 <tr id="id${id(_user_group.users_group_name)}">
138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
@@ -148,6 +148,7
148 %else:
148 %else:
149 ${h.link_to_group(_user_group.users_group_name)}
149 ${h.link_to_group(_user_group.users_group_name)}
150 %endif
150 %endif
151 (${_('members')}: ${len(_user_group.members)})
151 </td>
152 </td>
152 <td class="td-action">
153 <td class="td-action">
153 <span class="btn btn-link btn-danger revoke_perm"
154 <span class="btn btn-link btn-danger revoke_perm"
@@ -90,7 +90,7
90 </div>
90 </div>
91 <div class="checkboxes">
91 <div class="checkboxes">
92 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
92 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
93 <span class="help-block">${_('Copy permission set from the parent repository group.')}</span>
93 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
94 </div>
94 </div>
95 </div>
95 </div>
96 <div class="field">
96 <div class="field">
@@ -128,7 +128,7
128 %endfor
128 %endfor
129
129
130 ## USER GROUPS
130 ## USER GROUPS
131 %for _user_group in c.rhodecode_db_repo.permission_user_groups():
131 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
132 <tr>
132 <tr>
133 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
133 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
134 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
134 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
@@ -143,6 +143,7
143 %else:
143 %else:
144 ${h.link_to_group(_user_group.users_group_name)}
144 ${h.link_to_group(_user_group.users_group_name)}
145 %endif
145 %endif
146 (${_('members')}: ${len(_user_group.members)})
146 </td>
147 </td>
147 <td class="td-action">
148 <td class="td-action">
148 <span class="btn btn-link btn-danger revoke_perm"
149 <span class="btn btn-link btn-danger revoke_perm"
@@ -135,7 +135,7
135 %endfor
135 %endfor
136
136
137 ## USER GROUPS
137 ## USER GROUPS
138 %for _user_group in c.user_group.permission_user_groups():
138 %for _user_group in c.user_group.permission_user_groups(with_members=True):
139 <tr>
139 <tr>
140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
@@ -150,6 +150,7
150 %else:
150 %else:
151 ${h.link_to_group(_user_group.users_group_name)}
151 ${h.link_to_group(_user_group.users_group_name)}
152 %endif
152 %endif
153 (${_('members')}: ${len(_user_group.members)})
153 </td>
154 </td>
154 <td class="td-action">
155 <td class="td-action">
155 <span class="btn btn-link btn-danger revoke_perm"
156 <span class="btn btn-link btn-danger revoke_perm"
@@ -86,7 +86,7
86 </div>
86 </div>
87 <div class="checkboxes">
87 <div class="checkboxes">
88 ${h.checkbox('copy_permissions',value="True", checked="checked")}
88 ${h.checkbox('copy_permissions',value="True", checked="checked")}
89 <span class="help-block">${_('Copy permissions from forked repository')}</span>
89 <span class="help-block">${_('Copy permissions from parent repository.')}</span>
90 </div>
90 </div>
91 </div>
91 </div>
92
92
General Comments 0
You need to be logged in to leave comments. Login now