Problem/Motivation
Currently users that have access to edit a course (for example via a group permission) may not be able to edit / add its lessons and activities (no global entity permissions). This is sometimes unexpected.
The lesson / activity access must be granted within the course scope only and based on the group edit access.
The real concern here is the create access and what happens with entities that are no longer referenced by any courses / lessons.
There are 2 possible paths here (feel free to propose any more):
1. an access policy that grants create permission to users being members of groups with edit permission
2. extending LMS Reference (or Drupal core's entity reference) field so it accepts an entity array to create an entity from and reference it at the same time (currently creation and referencing happen in 2 different places so we cannot verify where the creation is coming from). For that to work, modal entity subforms would need to pass the array to the parent form instead of saving the new entity. Much more complex approach and there's a risk of data loss if the course form is closed before saving.
Steps to reproduce
Add a user without global permissions to a course with a group role that allows editing the group - course lessons will not be editable.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork lms-3618925
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
graber commentedComment #4
graber commentedComment #5
graber commented