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

Issue #3487312: Site managers can't see content of groups they are not part of #4184

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

vcsvinicius
Copy link
Contributor

@vcsvinicius vcsvinicius commented Nov 13, 2024

Problem (for internal)

The site-managers is not able to see the content in groups that they are not part of. So as for now, the group membership kind of outweighs the site manager status, which should not be the case.

Solution (for internal)

We are using 'bypass group access' permission from group module and it was removed after version 2, check #3259076

So I changed the validation to check group-permission from logged user.

Release notes (to customers)

Fixed access from site-manager at group contents without be part of them.

Issue tracker

PROD-31123
#3487312

Theme issue tracker

N/A

How to test

  • Create a group
  • Create some posts private to group and others for community
  • Log-in with site-managers not-member of group created before
  • Go to group and check the posts, the site-managers should be able to see all content from group

Change Record

N/A

Translations

N/A

@vcsvinicius vcsvinicius added type: bug Fixes a bug in Open Social status: needs review This pull request is waiting for a requested review prio: medium team: guardians labels Nov 13, 2024
@vcsvinicius vcsvinicius added this to the 13.0.0-alpha18 milestone Nov 13, 2024
@vcsvinicius vcsvinicius requested a review from a team November 13, 2024 18:17
…cessControlHandler

The 'bypass group access' permission isn't available anymore and the 'bypass create group access' should be enought because CM and SM already have this permission.
@vcsvinicius vcsvinicius force-pushed the bugfix/3487312/sm-cannot-see-content-of-groups branch from e202f99 to 7196b26 Compare November 21, 2024 14:56
@@ -205,7 +224,11 @@ public function query():void {
$post_access = new Condition('AND');
$post_access->condition('activity__field_activity_entity.field_activity_entity_target_type', 'post');

if (!$account->hasPermission('bypass group access')) {
// Get group from url-parameter.
$group = $this->routeMatch->getParameter('group');
Copy link
Contributor

Choose a reason for hiding this comment

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

you are lucky that #4118 is not merged yet, it brings a current group service that could have been used. :)

Copy link
Contributor

@denis-getopensocial denis-getopensocial left a comment

Choose a reason for hiding this comment

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

👍

@denis-getopensocial
Copy link
Contributor

Tested and all good.
Screenshot done as Site Manager not belonging to the group.
Screenshot 2024-12-03 at 14 46 24

@vcsvinicius vcsvinicius merged commit 1d58128 into main Dec 5, 2024
196 checks passed
@vcsvinicius vcsvinicius deleted the bugfix/3487312/sm-cannot-see-content-of-groups branch December 5, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: medium status: needs review This pull request is waiting for a requested review team: guardians type: bug Fixes a bug in Open Social
Development

Successfully merging this pull request may close these issues.

3 participants