I have found an example of setting role's permissions in the template.xml file that comes with the module:
<!-- overwirte will cause all other permissions for rid 4
(except those defined within this action) to be reset/disabled
-->
<permissions rid="editor" overwrite="1">access comments, administer blocks, administer filters, post comments</permissions>
This code doesn't seem to work as expected. Values supplied in the
tag do not overwrite the existing permissions but get merged with them. i.e. overwrite="1" seems to be ignored
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | components-user.inc-2.patch | 1.08 KB | dan.nsk |
| #1 | components-user.inc_.patch | 650 bytes | dan.nsk |
Comments
Comment #1
dan.nsk commentedPatch attached
Comment #2
dan.nsk commentedAfter further experiments I discovered an another similar problem with permissions modifying.
Patterns with delete attribute set to "1" do not work properly either. The following example has been taken from the template.xml supplied with the module:
After running such a pattern the role keeps all its previous permissions and is given one extra (the first item of the general permissions list).
Here is a new improved patch that fixes both of the problems - with delete and overwrite attributes
Comment #3
Shawn_S commentedI just noticed this as well so I applied your patch and it solved the problem.
1+ vote for this patch to be included.
Comment #4
dan.nsk commentedThis is kind of temporary solution. After all problems with handling of checkboxes in patterns_sync_form_values() are solved (see #588040: Disabling modules fails for explanation) this patch will become redundant.
Comment #5
vaish commentedIssue with patterns_sync_form_values() has been fixed which makes this patch unnecessary. Both "overwrite" and "delete" should work now as expected. Please let me know if you still run into any issues.
@dan.nsk - thanks for providing this patch as an interim solution.
Vaish