Permissions: restrict transition [via Workflow Button] access based on User Role

Created on 6 September 2023, over 1 year ago
Updated 15 April 2024, 9 months ago

Problem/Motivation

Show or hide the Workflow buttons based on the User roles

Steps to reproduce

Proposed resolution

Are any custom hooks available

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: works as designed

Version

1.0

Component

Workflow Access: UI

Created by

🇮🇳India sundarraj.p

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sundarraj.p
  • 🇳🇱Netherlands johnv

    I am nog sure what you wish:
    - change all workflow buttons back to radiobuttons/checkboxes and normal action buttons, per user role? At the moment, this is not possible, but you can create your hook_FORM_ID_Alter() function.
    - limit the number of buttons, based upon the access set to the user. (This would be a bug: only buttons for allowed transitions should be displayed)

  • Status changed to Closed: works as designed 9 months ago
  • 🇳🇱Netherlands johnv

    This works as designed:
    - Maintain state transitions in admin/config/workflow/workflow/WORKFLOW_TYPE/transition_roles
    - Under Permissions page, make sure the role required has proper permission to work with workflow.
    - test with a user with configured role.
    - Make sure you are not using User 1, since that used bypasses all access rules.

    You can test by toggling the field 'How to show the available states' between Buttons/Select in /admin/config/workflow/workflow/WORKFLOW_TYPE.
    The resulting permitted states should be the same.

    Please check workflow.api.php or the Event subdirectory for code examples.

  • 🇳🇱Netherlands johnv

    Unless your problem is with the settings in the following page: /admin/config/workflow/workflow/WORKFLOW_TYPE/access .
    If so, please reopen with some more details.

Production build 0.71.5 2024