Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[studio-ui] permittedRoles is not working for widget PublishingStatusButton #6158

Closed
2 of 5 tasks
phuongnq opened this issue Jul 18, 2023 · 1 comment
Closed
2 of 5 tasks

Comments

@phuongnq
Copy link
Member

Duplicates

  • I have searched the existing issues

Latest version

  • The issue is in the latest released 4.2.x
  • The issue is in the latest released 4.1.x
  • The issue is in the latest released 4.0.x
  • The issue is in the latest released 3.1.x

Describe the issue

We would like to hide the publishing status button in the toolbar so it's only visible for admin users and not for the rest of the users. But updating the permittedRoles does not work for the widget craftercms.components.PublishingStatusButton

Steps to reproduce

Steps:

  1. Create a new site from Editorial BP
  2. Update the ui.xml as the following:
<widget id="craftercms.components.PublishingStatusButton">
                        <permittedRoles>
                          <role>admin</role>
                        </permittedRoles>
                        <configuration>
                            <variant>icon</variant>
                        </configuration>
                    </widget>
  1. Notice that the studio is blank and there is an error in the console:
TypeError: e.permittedRoles.includes is not a function
    at renderWidgets.tsx:42:68
    at Array.some (<anonymous>)
    at renderWidgets.tsx:42:31
    at Array.filter (<anonymous>)
    at r (renderWidgets.tsx:39:10)
    at P (ToolBar.tsx:83:12)
    at qa (react-dom.production.min.js:167:137)
    at Wu (react-dom.production.min.js:197:258)
    at qc (react-dom.production.min.js:292:88)
    at As (react-dom.production.min.js:280:389)

Relevant log output

No response

Screenshots and/or videos

2023-07-18_13-15

@phuongnq phuongnq added bug triage Requires triage labels Jul 18, 2023
@sumerjabri sumerjabri added this to Backlog in Crafter CMS v4 via automation Jul 18, 2023
@sumerjabri sumerjabri added this to the Crafter CMS v4.1.1 milestone Jul 18, 2023
@sumerjabri sumerjabri changed the title permittedRoles is not working for widget PublishingStatusButton [studio-ui] permittedRoles is not working for widget PublishingStatusButton Jul 18, 2023
@sumerjabri sumerjabri added the CI label Jul 18, 2023
@rart rart assigned phuongnq and unassigned rart Jul 18, 2023
@rart rart moved this from Backlog to In Progress in Crafter CMS v4 Jul 18, 2023
@rart rart moved this from In Progress to Test & Validate in Crafter CMS v4 Jul 18, 2023
@sumerjabri sumerjabri added validate and removed triage Requires triage labels Jul 18, 2023
@phuongnq
Copy link
Member Author

Verified!

Crafter CMS v4 automation moved this from Test & Validate to Completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Crafter CMS v4
  
Completed
Development

No branches or pull requests

3 participants