diff options
Diffstat (limited to 'ogcp/forms')
-rw-r--r-- | ogcp/forms/auth.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ogcp/forms/auth.py b/ogcp/forms/auth.py index d85931b..a76ec7c 100644 --- a/ogcp/forms/auth.py +++ b/ogcp/forms/auth.py @@ -7,7 +7,8 @@ from wtforms import ( Form, SubmitField, HiddenField, SelectField, BooleanField, IntegerField, - StringField, RadioField, PasswordField, SelectMultipleField, widgets + StringField, RadioField, PasswordField, SelectMultipleField, FormField, + widgets ) from wtforms.validators import InputRequired, Optional from flask_wtf import FlaskForm @@ -28,6 +29,12 @@ class LoginForm(FlaskForm): ) +class PermissionForm(FlaskForm): + add = BooleanField(_l('Add'), default=True) + update = BooleanField(_l('Update'), default=True) + delete = BooleanField(_l('Delete'), default=True) + + class UserForm(FlaskForm): username = StringField( label=_l('Username'), @@ -50,6 +57,12 @@ class UserForm(FlaskForm): option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False) ) + client_permissions = FormField(PermissionForm, label=_l('Client Permissions')) + center_permissions = FormField(PermissionForm, label=_l('Center Permissions')) + room_permissions = FormField(PermissionForm, label=_l('Room Permissions')) + folder_permissions = FormField(PermissionForm, label=_l('Folder Permissions')) + image_permissions = FormField(PermissionForm, label=_l('Image Permissions')) + repository_permissions = FormField(PermissionForm, label=_l('Repository Permissions')) submit_btn = SubmitField( label=_l('Submit') ) |