Added additional permission viewer

This commit is contained in:
Ozzieisaacs
2019-05-19 18:39:34 +02:00
parent 0c80f5c63a
commit f70c839014
8 changed files with 49 additions and 8 deletions

View File

@@ -185,6 +185,8 @@ def view_configuration():
content.config_default_role = content.config_default_role + ub.ROLE_ADMIN
if "download_role" in to_save:
content.config_default_role = content.config_default_role + ub.ROLE_DOWNLOAD
if "viewer_role" in to_save:
content.config_default_role = content.config_default_role + ub.ROLE_VIEWER
if "upload_role" in to_save:
content.config_default_role = content.config_default_role + ub.ROLE_UPLOAD
if "edit_role" in to_save:
@@ -651,6 +653,11 @@ def edit_user(user_id):
elif "download_role" not in to_save and content.role_download():
content.role = content.role - ub.ROLE_DOWNLOAD
if "viewer_role" in to_save and not content.role_viewer():
content.role = content.role + ub.ROLE_VIEWER
elif "viewer_role" not in to_save and content.role_viewer():
content.role = content.role - ub.ROLE_VIEWER
if "upload_role" in to_save and not content.role_upload():
content.role = content.role + ub.ROLE_UPLOAD
elif "upload_role" not in to_save and content.role_upload():