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

Fix: User can see events that are not assigned to it #14355

Merged
merged 7 commits into from Aug 7, 2020
Merged

Conversation

fmarcet
Copy link
Contributor

@fmarcet fmarcet commented Aug 3, 2020

A user can see events that are not assigned if he accesses directly through the url. The function only checks that the user has permission to view their events, but not if the user is assigned to that event.

@@ -247,6 +248,25 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{
if (! $user->rights->projet->lire && ! $user->rights->projet->all->lire) { $readok=0; $nbko++; }
}
elseif ($feature == 'agenda')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of code is dedicated to check on brut permission only, whatever is object analyzed. Few lines later, there is a call to
checkUserAccessToObject()
If we must make a test on a dedicated object id, we must add it in this function checkUserAccessToObject .
Can you try to move this code into this function checkUserAccessToObject()

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Aug 4, 2020
@fmarcet
Copy link
Contributor Author

fmarcet commented Aug 4, 2020

Hi @eldy I have moved it inside the function checkUserAccessToObject

@eldy eldy merged commit 5482a31 into Dolibarr:10.0 Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants