diff options
author | Frederick Muriuki Muriithi | 2023-04-25 09:55:11 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-04-25 09:55:11 +0300 |
commit | 9c526589575c0f0f1f4de5941d85f0c5adeccff6 (patch) | |
tree | 8fe4c2055e9d776df6939a3e867d4b86df3c2ea9 | |
parent | 4ab9378f7578e7ac66816f8513748d0016ca5c66 (diff) | |
download | genenetwork2-9c526589575c0f0f1f4de5941d85f0c5adeccff6.tar.gz |
auth: disable UI elements for non-editable roles
If a role is not user-editable, disable the UI elements that allow
editting of the role to prevent that as an option in the first place.
-rw-r--r-- | wqflask/wqflask/oauth2/ui.py | 1 | ||||
-rw-r--r-- | wqflask/wqflask/templates/oauth2/view-group-role.html | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/wqflask/wqflask/oauth2/ui.py b/wqflask/wqflask/oauth2/ui.py index 31b873be..4fdbe869 100644 --- a/wqflask/wqflask/oauth2/ui.py +++ b/wqflask/wqflask/oauth2/ui.py @@ -2,6 +2,7 @@ from flask import session, render_template from .client import oauth2_get +from .request_utils import process_error def render_ui(templatepath: str, **kwargs): """Handle repetitive UI rendering stuff.""" diff --git a/wqflask/wqflask/templates/oauth2/view-group-role.html b/wqflask/wqflask/templates/oauth2/view-group-role.html index 5536d475..efc8fd75 100644 --- a/wqflask/wqflask/templates/oauth2/view-group-role.html +++ b/wqflask/wqflask/templates/oauth2/view-group-role.html @@ -37,7 +37,10 @@ <input type="hidden" name="privilege_id" value="{{privilege.privilege_id}}" /> <input type="submit" class="btn btn-danger" - value="Remove" /> + value="Remove" + {%if not group_role.role.user_editable%} + disabled="disabled" + {%endif%} /> </form> </td> </tr> @@ -72,7 +75,10 @@ <input type="hidden" name="privilege_id" value="{{priv.privilege_id}}" /> <input type="submit" class="btn btn-warning" - value="Add to Role" /> + value="Add to Role" + {%if not group_role.role.user_editable%} + disabled="disabled" + {%endif%} /> </form> </td> </tr> |