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

Bug with "has same role as creator" with custom roles #8129

Closed
MickaelFondation opened this issue Oct 1, 2020 · 7 comments · Fixed by #8202
Closed

Bug with "has same role as creator" with custom roles #8129

MickaelFondation opened this issue Oct 1, 2020 · 7 comments · Fixed by #8202
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@MickaelFondation
Copy link

Hi, I created a role custom then I give two users this same role and I set Has same role as creator. When I added something with one user the other one can see something new on the list but everything inside is empty. I think this is a bug

Describe the bug
It look likes the parameter "define condition" "Has same role as creator" doesn't work properly. When it's set to a specific Collection Types (on read condition for example). The number of elements correspond but in the liste there is "-" character at the place of datas and when I click to modify every field are empty.

Steps to reproduce the behavior

  1. Having two user with the same custom role
  2. Create an entry in a collection type with one of the users
  3. As an administrator go to Permission then Roles
  4. Edit the role of the two previous user
  5. Click on parameters who is display on mouseover on the collection types who correspond of the one you created before
  6. Select "Has same role as creator" next to CAN READ WHEN
  7. Apply
  8. Go to the right collection type on the main menu
  9. The entry appear on the list but with no data (only '-' character on the list)

Expected behavior
The right behavior is to see datas on the list and when i edit the collection types entity.

Screenshots
bugstrapirole

System

Strapi self hosted 3.1.3

@derrickmehaffy
Copy link
Member

Can you clarify which roles you are referring to? I assume you mean the Admin panel roles. Are you an EE user as the CE version is limited only to the 3 predefined roles.

@MickaelFondation
Copy link
Author

It's a custom role I just created
customerolestrapiexemple
Exactly it's admin panel not api role.
I am no longer limited to 3 predefined roles since I paid for bronze plan (I can create 30 roles)

@derrickmehaffy
Copy link
Member

Ah perfect that makes more sense, let me get a license key and do some testing and I'll get back to you shortly ;)

@MickaelFondation
Copy link
Author

Great thank you :)

@MickaelFondation
Copy link
Author

Any news?

@derrickmehaffy
Copy link
Member

Apologies I didn't get to this last week, I have license in hand and will be taking a look today :)

@derrickmehaffy derrickmehaffy added severity: high If it breaks the basic use of the product source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members issue: bug Issue reporting a bug labels Oct 5, 2020
@derrickmehaffy
Copy link
Member

I can confirm this on v3.1.7 with the following steps to reproduce:

  • Create a new model called article with two fields
    • title - string
    • body - richtext
  • Create a new role test
  • Assign all field permissions but apply custom conditions
    • Can Create => Anytime
    • Can Read => is same role
    • Can Update => is owner
    • Can delete => is owner
  • Create 2 test users
  • Create an article on one
  • Attempt to read on the other

See both the list and edit views are empty for user two. As a side point, trying to update as user 2 just yield a giant "SERVER ERROR" message. NOTE to test you need an EE License of any type.

Test project attached.
test8129.zip

Super User Login
test@test.com
Test1234!

User 1 Login
test1@test.com
Test1234!

User 2 Login
test2@test.com
Test1234!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants