-
Notifications
You must be signed in to change notification settings - Fork 133
Prevent OgMemberships to be created with the 'non-member' and 'member' role #174
Prevent OgMemberships to be created with the 'non-member' and 'member' role #174
Conversation
@@ -204,15 +225,6 @@ public function entityOperationAccessProvider() { | |||
], | |||
], | |||
[ | |||
// Non-members should have the right to edit any group 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.
@dakala you have removed this part for now, just because the tests failed, right?
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.
@amitaibu Not just now. I removed it because the old test assigned a non-member role to a membership. The member role is assigned to a membership automatically so that's not a problem here.
I mentioned some time ago I didn't know how to make the Wiki functionality work for a core authenticated user. Once I understand how the wiki works (i.e. what enables wiki on a piece of content) I can write a test for the "non-member" role - a core authenticated use r who isn't a member of the group.
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.
There's isn't really wiki
feature - the name of the file can change. It's just about checking different scenarios of permissions. So wiki
refers here to the fact that a non-member can edit existing group content.
Ok, let's rename it. That name and functionality made sense when an OgMembership could have a "non-member" role. Shall we say |
|
@@ -204,15 +225,6 @@ public function entityOperationAccessProvider() { | |||
], | |||
], | |||
[ | |||
// Non-members should have the right to edit any group 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.
Ok, I'll give this a look now
$role->grantPermission('edit any group_content content'); | ||
$role->save(); | ||
/** @var OgRole $role */ | ||
$role = OgRole::getRole('block_content', 'group', $role_name); |
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.
@dakala I've re-added saving the roles for non-members as-well (and even used the new OgRole::getRole
). The error was that a few lines below we didn't re-load the $role for the auth user, thus saved the membership with the wrong role.
Merged, thanks. |
Re-rolled #165