-
Notifications
You must be signed in to change notification settings - Fork 16
IBX-9838: FIX Edit option in three-dot menu remains clickable despite insufficient user permissions #1525
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
base: 4.6
Are you sure you want to change the base?
Conversation
|
@@ -226,7 +226,7 @@ private function getLocationPermissionRestrictions(Location $location): array | |||
'restrictedLanguageCodes' => $createLimitationsValues[Limitation::LANGUAGE], | |||
], | |||
'edit' => [ | |||
'hasAccess' => $lookupUpdateLimitationsResult->hasAccess(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked other uses of this method? If it does not work correctly, it should be fixed, or all usage should be replaced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to investigate this one, we have another variable lookupUpdateLimitationsResult
thats also not working correctly here, I will come back here once I have done some test.
return $this->permissionResolver->canUser( | ||
'content', | ||
'edit', | ||
$content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to pass any targets here as a fourth argument?
Description:
As stated in the public ticket, when the user has a limitation, for example, only for a specific content type, lets say
Article
, if we go to the Content tree, click on any other content type and open the context menu, the edit button would be clickable and it would throw a permission error.I'm fixing here the edit check to rely on
this->permissionResolver->canUser
instead ofhasAccess
method.