Mercurial > kallithea
comparison rhodecode/model/forms.py @ 3628:c734686b3cf2 beta
moved permission management into separate entity.
- this solves issues when whole form submision could influence permission management
particular case is that when repo group permission is revoked and user is no longer able to update repository settings
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 28 Mar 2013 02:11:26 +0100 |
parents | af96fb19b53a |
children | 802c94bdfc85 |
comparison
equal
deleted
inserted
replaced
3627:32cb8d45f330 | 3628:c734686b3cf2 |
---|---|
197 if edit: | 197 if edit: |
198 #this is repo owner | 198 #this is repo owner |
199 user = All(v.UnicodeString(not_empty=True), v.ValidRepoUser()) | 199 user = All(v.UnicodeString(not_empty=True), v.ValidRepoUser()) |
200 | 200 |
201 chained_validators = [v.ValidCloneUri(), | 201 chained_validators = [v.ValidCloneUri(), |
202 v.ValidRepoName(edit, old_data), | 202 v.ValidRepoName(edit, old_data)] |
203 v.ValidPerms()] | |
204 return _RepoForm | 203 return _RepoForm |
204 | |
205 | |
206 def RepoPermsForm(): | |
207 class _RepoPermsForm(formencode.Schema): | |
208 allow_extra_fields = True | |
209 filter_extra_fields = False | |
210 chained_validators = [v.ValidPerms()] | |
211 return _RepoPermsForm | |
205 | 212 |
206 | 213 |
207 def RepoFieldForm(): | 214 def RepoFieldForm(): |
208 class _RepoFieldForm(formencode.Schema): | 215 class _RepoFieldForm(formencode.Schema): |
209 filter_extra_fields = True | 216 filter_extra_fields = True |