Problem/Motivation
In #2571235: [regression] Roles should depend on objects that are building the granted permissions @alexpott found out that a number of entity permissions are not in the module that is providing the entity. For instance the permission "administer views" is in the views_ui module and not in the views module.
Proposed resolution
Move entity permissions to the modules that are providing the entity.
The following permissions will be moved:
- The permission "administer actions" has been moved from the action module to the system module;
- The permissions "administer url aliases" and "create url aliases" have been moved from the path module to the path_alias module;
- The permission "administer views" has been moved from the views_ui module to the views module;
- For all fieldable entities: The permissions "administer ENTITY_TYPE fields", "administer ENTITY_TYPE form display" and "administer ENTITY_TYPE display" have been moved from the field_ui module to the field module.
Remaining tasks
Review patch
Commit patch
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
For the committer
The idea for this issue comes from @alexpott. Therefore he should get a commit credit for this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3193983-nr-bot.txt | 143 bytes | needs-review-queue-bot |
| #2 | 3193983-2.patch | 3.77 KB | daffie |
Comments
Comment #2
daffie commentedI did a search for who might be using Drupal\field_ui\FieldUiPermissions, and I could not find anybody. See: http://grep.xnddx.ru/search?text=FieldUiPermissions&filename=.
There is alraedy for all the moved permissions a lot of testing. Therefore no new testing added.
Comment #3
daffie commentedComment #4
longwaveJust in case someone is using FieldUiPermissions, we could add
class FieldUiPermissions extends FieldPermissions {}with atrigger_error()deprecation if the class is loaded?Comment #5
alexpottFWIW I'm not sure about this. It's really tricky. From a UI perspective it's not great to have these permissions around when the corresponding UI module is not available.
Comment #6
alexpottA bit more on #5. For example, if administer actions move to system you'd expect if you tick that box on the permissions form a UI would become available. But it won't. You'll need to install the actions module.
I think this might be a won't fix... and something that the JSON API module needs to deal with. I.e. it needs to create an missing permissions if they are resources that require permissions that don't exist.
OR... we need new permissions for the entities.... but that's another can or worms.
Comment #9
stephencamilo commentedComment #10
andypostComment #13
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #15
macsim commented+1 on #5
I don't see a reason to have the "administer views" permission available if the Views UI module is disabled nor the "administer ENTITY_TYPE fields" when Field UI is disabled.
Comment #16
catchYeah I think these permissions were added to the UI modules for a reason. Reducing the priority here.