In #1217128: limiting Rules components to specific permissions, added the ability to attach a custom permission to each Rules component, allowing execution of that component only for users who have the permission. There is a UI for adding and managing these permissions, and tests for them as well. There is also a recent fix to a long-standing problem with that UI - the fix and the patch may be found in #2340505: UI for "Configure access for using this component with a permission" is broken.

This current issue was opened up as a follow-up, to address the EXPORT of Rules that have a custom permission attached.

In #1217128-55: limiting Rules components to specific permissions Nicolas Bouteille said:

Hi I just used the new permission option you guys created. It works thanks !
BUT ! The selected roles are not included in the snippet when trying to EXPORT the component. It only says that access_exposed is set to true but it does not say which roles have access to the component.

In #1217128-59: limiting Rules components to specific permissions TR said:

Confirmed that the selected roles are not exported. I will have to think about how this should work since per-role permissions are stored in the usual {role_permissions} table, and the component just contains the access_exposed key to indicate that there is a specific permission dynamically defined for this component. I don't like the idea of having an imported component granting permissions covertly upon import, and since role ids are site-specific they are really not very 'importable' as part of the component.

Comments

TR created an issue. See original summary.

tr’s picture

Status: Active » Postponed
Parent issue: » #1217128: limiting Rules components to specific permissions

There has been no community interest in this feature for 7 years (as indicated by the lack of support questions or bug reports about component permission), and no community interest even in fixing the major bug in #2340505: UI for "Configure access for using this component with a permission" is broken which prevented the component permission UI from working correctly.

As a practical matter I'm marking this as postponed because I'm not going to work on it. But if someone is interested in pursuing this issue then please feel free to post a patch and change this back to active.

tr’s picture

Issue summary: View changes