diff --git a/CHANGES.rst b/CHANGES.rst index 6f53d30f35..9dc622e04b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -38,6 +38,11 @@ Fixes (`#629 `_). Minor cleanup of ``HTTPRequest.get``. +Other changes ++++++++++++++ + +- Fixed usability on ZMI Security tab forms for sites with many roles + 4.0 (2019-05-10) ---------------- diff --git a/src/OFS/dtml/access.dtml b/src/OFS/dtml/access.dtml index edbda2319a..0d2df0a9da 100644 --- a/src/OFS/dtml/access.dtml +++ b/src/OFS/dtml/access.dtml @@ -8,19 +8,15 @@
+ +

The listing below shows the current security settings for this item. - Permissions are rows and roles are columns. Checkboxes are used to - indicate where roles are assigned permissions. You can also assign + You can also assign local roles to users, which give users extra roles in the context of this object and its subobjects.
- When a role is assigned to a permission, users with the given role - will be able to perform tasks associated with the permission on this - item. When the Acquire permission settings checkbox is selected - then the containing objects's permission settings are used. Note: the - acquired permission settings may be augmented by selecting Roles for - a permission in addition to selecting to acquire permissions.

@@ -42,81 +38,131 @@
- -
- - - - - - - - - - - - - - - - - - +
- Permissions - " - class="zmi-table-head-roles">Roles 
- - Acquire? - - Permission -
&dtml-sequence-item;
+
+ + + +

Permissions

+ +

+ Click on one of the permission names to see the roles they are assigned + to. +

+ + + + + + + +
+ + &dtml-pname; + +
+ + + +

Role to permission assignments

+ +

+ This table shows which permissions are assigned to each role. Permissions + are rows and roles are columns.
+ When a role is assigned to a permission, users with the given role + will be able to perform tasks associated with the permission on this + item. + +
+ When the Acquire? checkbox is selected + then the containing objects's permission settings are used. Note: the + acquired permission settings may be augmented by selecting Roles for + a permission in addition to selecting to acquire permissions. +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + - -
+ Permissions + " + class="zmi-table-head-roles">Roles 
+ + Acquire? + Permission +
&dtml-sequence-item;
+
 
+ +   + + + + + &dtml-name; + " + onclick="$(this).children('input').trigger('click')"> + + +
 
 
- -   - - - - - &dtml-name; - " - onclick="$(this).children('input').trigger('click')"> - - -  
+
-
- -
-
-
+
+ +
+ + + + + +
+
+ +

Add or delete user-defined roles

+

You can define new roles by entering a role name and clicking the "Add Role" button. diff --git a/src/OFS/dtml/editLocalRoles.dtml b/src/OFS/dtml/editLocalRoles.dtml index bf68762a26..8d7c909b2a 100644 --- a/src/OFS/dtml/editLocalRoles.dtml +++ b/src/OFS/dtml/editLocalRoles.dtml @@ -5,6 +5,8 @@

+ +

Local roles for user &dtml-userid;

Local roles allow you to give particular users extra roles in the context of this object, in addition to the roles they already have. @@ -15,37 +17,27 @@

- - - - - - - - - - - - - + + +
UserRoles
- &dtml-userid; - - - - - -
+ + + + + + + + + +
+ + checked + /> + &dtml-sequence-item;
diff --git a/src/OFS/dtml/listLocalRoles.dtml b/src/OFS/dtml/listLocalRoles.dtml index 5887e07233..dac4eaadaa 100644 --- a/src/OFS/dtml/listLocalRoles.dtml +++ b/src/OFS/dtml/listLocalRoles.dtml @@ -22,9 +22,8 @@

- - + @@ -86,17 +85,18 @@ - + + &dtml-sequence-item; + - + diff --git a/src/OFS/dtml/permissionEdit.dtml b/src/OFS/dtml/permissionEdit.dtml index a94db89a3c..0e61350ed9 100644 --- a/src/OFS/dtml/permissionEdit.dtml +++ b/src/OFS/dtml/permissionEdit.dtml @@ -15,11 +15,18 @@ - checked> + + &dtml-name; + - +
diff --git a/src/OFS/role.py b/src/OFS/role.py index a8f81d6d53..45464d45de 100644 --- a/src/OFS/role.py +++ b/src/OFS/role.py @@ -172,9 +172,12 @@ def manage_addLocalRoles(self, userid, roles, REQUEST=None): @security.protected(change_permissions) @requestmethod('POST') - def manage_setLocalRoles(self, userid, roles, REQUEST=None): + def manage_setLocalRoles(self, userid, roles=[], REQUEST=None): """Set local roles for a user.""" - BaseRoleManager.manage_setLocalRoles(self, userid, roles) + if roles: + BaseRoleManager.manage_setLocalRoles(self, userid, roles) + else: + return self.manage_delLocalRoles((userid,), REQUEST) if REQUEST is not None: stat = 'Your changes have been saved.' return self.manage_listLocalRoles(self, REQUEST, stat=stat)