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

"Has same role as creator" permission settings are not applied #330

Open
manu7823 opened this issue Apr 27, 2023 · 4 comments
Open

"Has same role as creator" permission settings are not applied #330

manu7823 opened this issue Apr 27, 2023 · 4 comments
Labels
feature request Community feature request v4 Strapi v4

Comments

@manu7823
Copy link

manu7823 commented Apr 27, 2023

Problem

Restricting "Read" and "Update" permissions to "Has same role as creator" doesn't work.

Steps to reproduce

  1. Create two roles and two users
  2. Grant only Has same role as creator permissions for the navigation plugin read and update operations

Bildschirmfoto 2023-04-27 um 19 41 04

  1. Assign one user to the first role and the other one to the second role, login with the first user and create a new navigation item

Bildschirmfoto 2023-04-27 um 19 39 13

  1. Logout with the first user, login with the second user and you can still see and edit the created navigation item of the first user with a different role than the currently logged in user.

Bildschirmfoto 2023-04-27 um 19 46 47

Setup

"dependencies": {
"@strapi/plugin-i18n": "~4.10.1",
"@strapi/plugin-users-permissions": "~4.10.1",
"@strapi/strapi": "~4.10.1",
"better-sqlite3": "^8.0.1",
"mysql": "^2.18.1",
"strapi-plugin-navigation": "^2.2.8"
}

@cyp3rius
Copy link
Contributor

@manu7823 what you're describing is more like a "virtual tenancy" so single user / role can have and edit dedicated navigation. Operating on the same navigation structure and showing items per roles won't be possible because of duplicates which may happen.

It's a custom solution in my opinion and honestly we did something like that based on Strapi + Navigation plugin for our client by extending Navigation Collection with tenant relation and assigning roles per tenants.

I'm worried that your case is too custom to make it part of common codebase unfortunately. Anyway keep your eyes open, during the Strapi Conf such use case might be presented ;)

@cyp3rius cyp3rius added feature request Community feature request v4 Strapi v4 labels Apr 27, 2023
@manu7823
Copy link
Author

@cyp3rius that's exactly what I try to achieve! Thank you for the hint according the Strapi Conf :) Is there any way you would share the code you wrote for your client with me?

@cyp3rius
Copy link
Contributor

I might not share the codebase as that's a business value of a client but discuss and showcase the idea ;)

@quarkcore
Copy link

quarkcore commented Jan 26, 2024

@manu7823 what you're describing is more like a "virtual tenancy" so single user / role can have and edit dedicated navigation. Operating on the same navigation structure and showing items per roles won't be possible because of duplicates which may happen.

It's a custom solution in my opinion and honestly we did something like that based on Strapi + Navigation plugin for our client by extending Navigation Collection with tenant relation and assigning roles per tenants.

I'm worried that your case is too custom to make it part of common codebase unfortunately. Anyway keep your eyes open, during the Strapi Conf such use case might be presented ;)

By now, this issue raises the problem that someone without permission, who should be able to edit navigation, could see other entity titles in edit mode inside navigation. That's a lack of business policies somehow. So, it's not usable if the application needs the combination of a role that can edit navigation but should only be able to have information about entities within its own role or things created on their own.

This makes the library some kind of backdoor and not usable in such cases... :(

[Edit[
To give context: i need to implement a feature where a given role can edit content of its own. as part of the content the role owners should be able to make use of some sort of sub navigations (mostly sidebars with links to other pages of there department) and at the same time aren't allowed to edit things like the main navigation.

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

No branches or pull requests

3 participants