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

Roles with the variable name across modules conflict with each other #8469

Open
aderderian opened this issue Jan 30, 2021 · 6 comments · May be fixed by #17385
Open

Roles with the variable name across modules conflict with each other #8469

aderderian opened this issue Jan 30, 2021 · 6 comments · May be fixed by #17385
Labels
Milestone

Comments

@aderderian
Copy link
Contributor

When creating a new module to build my own workflows I called Acme.Modules.Workflows, I added a permission class and named a permission "ManageWorkflows". When the Roles screen enumerates the roles to be selected, the checkbox for these roles created a unique id on the page of Checkbox.ManageWorkflows for both the Orchard Workflows module and mine. We Probably need a unique id to underscore the the Module Name or namespace it is coming from. "Acme_ManageWorkflows"

The result is you can't check your permissions properly, it this could potentially trickle down to setting the wrong permissions.

@hishamco
Copy link
Member

AFAIK the permissions are grouped by module

@aderderian
Copy link
Contributor Author

AFAIK the permissions are grouped by module

They are, but the unique control names under them are not. Just by property name.

@hishamco
Copy link
Member

if the control names are same this a bug of course, you could send a PR for it

@deanmarcussen
Copy link
Member

If the value of your new permission is ManageWorkflows as well as the actual type name, they will conflict with each other.

Permission (claims) values are strings, so creating two permissions with the same value is essentially duplicating the permission.

If you want it to have a different permission you would need to give it a different value.

@DavidStania
Copy link
Contributor

DavidStania commented Mar 14, 2023

I'm running into the same issue.
If different modules having the same permissionnames, then we get undefined behaviours.

demo

@sebastienros sebastienros added this to the 1.x milestone Apr 20, 2023
@sebastienros
Copy link
Member

Feel free to open a PR to fix the id generation.

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

Successfully merging a pull request may close this issue.

5 participants