From: Valerie Pond Date: Fri, 21 Apr 2023 00:54:04 +0000 (+0100) Subject: Add the beginning of user roles X-Git-Tag: 0.9~149 X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/commitdiff_plain/4b48b46f55bb6a03a29d0d0db04b3076c1eaae8f?ds=sidebyside;hp=f60a30c1b89fbec3e1b8b8c7b3291f3f99cbf9c5 Add the beginning of user roles --- diff --git a/Classes/class-hook.php b/Classes/class-hook.php index fc7f71a..cab4ef3 100644 --- a/Classes/class-hook.php +++ b/Classes/class-hook.php @@ -133,6 +133,10 @@ define('HOOKTYPE_USER_PERMISSION_LIST', 116); define('HOOKTYPE_EDIT_USER', 117); +define('HOOKTYPE_USER_ROLE_LIST', 118); + +define('HOOKTYPE_EDIT_ROLE', 119); + define('HOOKTYPE_AUTH_MOD', 200); diff --git a/Classes/class-paneluser.php b/Classes/class-paneluser.php index 4758198..a13b623 100644 --- a/Classes/class-paneluser.php +++ b/Classes/class-paneluser.php @@ -328,3 +328,67 @@ function generate_panel_user_permission_table($user) get_panel_user_permission_list(), // SuperAdmin can do everything + "Read Only" => [], // Read Only can do nothing + ]; + + Hook::run(HOOKTYPE_USER_ROLE_LIST, $list); + return $list; +} + +function generate_role_list($list) +{ + $list2 = get_panel_user_permission_list(); + ?> +
Roles List:
+
+
+
+ + $slug) {?> +
+
+ +
+ +
+
+ $slug) + { + $attributes = ""; + $attributes .= ($role == "Super Admin" || $role == "Read Only") ? "disabled " : ""; + + ?> +
+
+
+ name="_permissions[]" value="" type="checkbox"> +
+
+ "> +
+ + +
+
+
+ + +

+
+ + +

User Role Editor

+ +Here, you can easily edit user roles to ensure that your team has the appropriate access and permissions they need.
+Some roles are built-in and cannot be deleted or modified.

+Click a role name to view role permissions.

+ + +
+

+ +

+
+
+
Creating a new role:
+
+
+ Role name +
+ +
+ +
+
+
Note: You must create a new role before you can add permissions to it.
+
+
+