Problem/Motivation
Permissions must exist
Invalid permissions will trigger runtime exceptions in Drupal 10. Permissions should be defined in a
permissions.ymlfile or a permission callback.The
skip_missing_permission_deprecationflag that was added in Drupal 9 to the Role entity in #2571235: [regression] Roles should depend on objects that are building the granted permissions.Modules cannot be in a disabled state anymore, only installed and uninstalled
#1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed# A special flag so we can migrate permissions that do not exist yet. # @todo Remove in https://www.drupal.org/project/drupal/issues/2953111. skip_missing_permission_deprecation: plugin: default_value default_value: trueIt was removed from the
10.0.xand10.1.xbranch.#2953111: Only migrate role permissions that exist on the destination
Proposed resolution
- Having the Module Installer Factory Class with Add Permissions for user roles from scanned directory #9
- #3193983: Move entity permissions to the module that is providing the entity
User roles creation will have no permissions in them in Varbase Profile.
user.role.anonymous.yml
user.role.authenticated.yml
user.role.content_admin.yml
user.role.editor.yml
user.role.seo_admin.yml
user.role.site_admin.yml
user.role.administrator.yml
Add all default user permission configs for active user roles in the "config/permissions" folder in the module.
config/permissions/user.permissions.anonymous.yml
config/permissions/user.permissions.authenticated.yml
config/permissions/user.permissions.content_admin.yml
config/permissions/user.permissions.editor.yml
config/permissions/user.permissions.seo_admin.yml
config/permissions/user.permissions.site_admin.yml
With the list of all needed to grant Permissions after making sure all
dependencies for modules or dependencies on configs.
Following with the new Drupal 10 practice.
When the module is enabled the needed permissions will be granted to the active user role by:
// Add permissions.
ModuleInstallerFactory::addPermissions('varbase_reports');
Remaining tasks
- ✅ File an issue about this project
- ✅ Addition/Change/Update/Fix to this project
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ Accessibility and Readability
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Update Release Notes and Update Helper on new feature change/addition
- ✅ Release varbase-9.0.15, varbase_reports-9.0.2, Varbase 10.0.0-beta1, varbase_reports-10.0.0-alpha1
Varbase update type
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Issue #3344815: Added Permissions for user roles to Varbase Reports from scanned
config/permissionsdirectory
Comments
Comment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
rajab natshahComment #8
rajab natshah✅ Released varbase_reports-9.0.2
Comment #9
rajab natshah✅ Released varbase_reports-10.0.0-alpha1
Comment #11
rajab natshah✅ Released varbase-9.0.15
Comment #12
rajab natshah✅ Released Varbase 10.0.0-beta1