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

Differentiate between role name and role key #179

Open
alexander-schranz opened this issue Feb 4, 2025 · 0 comments
Open

Differentiate between role name and role key #179

alexander-schranz opened this issue Feb 4, 2025 · 0 comments

Comments

@alexander-schranz
Copy link
Member

Discussed in #177

Originally posted by RafaelKr December 3, 2024
We're creating a role called Portal Customer. We'd like to use the role key portal_customer for that. Especially because for Symfony the role would be called ROLE_SULU_PORTAL CUSTOMER (note the space) without setting the key.

I'd like to create a PR, but we have the following options:

  1. Create a new configuration key in config/packages/sulu_community.yaml with the path sulu_community.website.role_name corresponding to the role configuration option.

  2. Create the PR to https://github.com/sulu/sulu and adjust the following line to replace spaces with underscores: https://github.com/sulu/sulu/blob/15a676466de29d815d016b37dd7cb97fef1cc76d/src/Sulu/Bundle/SecurityBundle/Entity/Role.php#L130. Of course this would be a breaking change so the PR would be against the 3.0 branch.
    Also the AsciiSlugger could be used which is available from Symfony 5.0, using _ as the seperator.

  3. Doing both PRs

What is your preferred approach to that? Of course I'm open to other solutions too.

Edit: AsciiSlugger is available starting from Symfony 5.0, before I told it's available from 7.1 as that is what the version selector in the documentation suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant