class _ReposGroupForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False group_name = All(v.UnicodeString(strip=True, min=1, not_empty=True), v.SlugifyName()) group_description = v.UnicodeString(strip=True, min=1, not_empty=False) if edit: #FIXME: do a special check that we cannot move a group to one of #it's children pass group_parent_id = All(v.CanCreateGroup(can_create_in_root), v.OneOf(available_groups, hideList=False, testValueList=True, if_missing=None, not_empty=True)) enable_locking = v.StringBoolean(if_missing=False) recursive = v.StringBoolean(if_missing=False) chained_validators = [v.ValidReposGroup(edit, old_data), v.ValidPerms('group')]
class _UserPermsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False chained_validators = [v.ValidPerms(type_='user_group')]
class _RepoGroupPermsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False recursive = v.StringBoolean(if_missing=False) chained_validators = [v.ValidPerms(type_='repo_group')]
class _RepoPermsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False chained_validators = [v.ValidPerms(type_='repo')]
class _RepoGroupPermsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False recursive = v.OneOf(valid_recursive_choices) chained_validators = [v.ValidPerms(type_='repo_group')]