Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Provide "delete" entity operation access checks on group entities #674

Closed
2 tasks done
pfrenssen opened this issue Jul 30, 2020 · 0 comments · Fixed by #681
Closed
2 tasks done

Provide "delete" entity operation access checks on group entities #674

pfrenssen opened this issue Jul 30, 2020 · 0 comments · Fixed by #681

Comments

@pfrenssen
Copy link
Contributor

pfrenssen commented Jul 30, 2020

Currently we only have full entity operation access checks for group content (see for example OgEventSubscriber::provideDefaultNodePermissions() which supplies these for node group content).

We have a group permission called update group but this is not currently enforced and (edit: is enforced now, ref. #673) test coverage for this is incomplete (ref. a user with this permission (user4) is created in OgEntityAccessTest but the test doesn't actually check that this user has edit access and other users don't.

We are also lacking a delete group permission. I think a create group permission is not needed, since this is controlled by Drupal permissions (a newly created group doesn't have any members yet so we cannot control this using an OG permission). We are ignoring view permissions too.

In order to fulfill this I propose:

  • Create a new GroupPermission to delete groups, apply it to the group admin by default, and treat it in the same way as the UPDATE_GROUP_PERMISSION.
  • Extend the tests, not only on the return value of the access checks like is being done in OgEntityAccessTest but also in scenarios where groups are actually being updated and deleted, i.e. through hook_entity_access().
@pfrenssen pfrenssen added this to the 8.x-1.0-alpha6 milestone Jul 30, 2020
@pfrenssen pfrenssen changed the title Provide entity operation access checks on group entities Provide "deleteentity operation access checks on group entities Aug 2, 2020
@pfrenssen pfrenssen changed the title Provide "deleteentity operation access checks on group entities Provide "delete" entity operation access checks on group entities Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant