FIX: respect moderator group permissions in guardian (#10713)

Since 9e4ed03, moderators can view groups with visibility level set to "Group owners, members and moderators".

This fixes an issue where moderators can see the group in /g but then get a 404 when clicking on individual groups.
This commit is contained in:
Penar Musaraj
2020-09-21 12:32:43 -04:00
committed by GitHub
parent f1743ff69c
commit 577293c438
3 changed files with 7 additions and 5 deletions

View File

@ -845,7 +845,7 @@ describe GroupsController do
end
it 'should not be able to update a group it cannot see' do
group.update!(visibility_level: 2)
group.update!(visibility_level: Group.visibility_levels[:owners])
put "/groups/#{group.id}.json", params: { group: { name: 'testing' } }