Problem/Motivation

Permissions must exist

Invalid permissions will trigger runtime exceptions in Drupal 10. Permissions should be defined in a permissions.yml file or a permission callback.

The skip_missing_permission_deprecation flag 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: true

It was removed from the 10.0.x and 10.1.x branch.

#2953111: Only migrate role permissions that exist on the destination

Proposed resolution

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('MODULE_NAME');

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-10.0.0-alpha1, varbase_core-10.0.0-alpha1, varbase-9.0.16, varbase_core-9.1.0, varbase_core-9.1.2

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 #3344805: Added Permissions for user roles to Varbase Core from scanned config/permissions directory

Comments

Rajab Natshah created an issue. See original summary.

  • Rajab Natshah committed be064e23 on 10.0.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed 37002b82 on 10.0.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed 1d44debd on 10.0.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed bba247f3 on 10.0.x
    Issue #3344805: Move - revert page revisions from Varbase Core to...

  • Rajab Natshah committed de41fc97 on 10.0.x
    Issue #3344805: Move - assign roles - permision from Varbase Core to...
rajab natshah’s picture

  • Rajab Natshah committed d25754d9 on 10.0.x
    Issue #3344805: Change access flood unblock permission to administer...

  • Rajab Natshah committed 79d5a2d0 on 10.0.x
    Issue #3344805: Have the right Entity Clone permissions for Varbase...

  • Rajab Natshah committed e3b81606 on 10.0.x
    Issue #3344805: Grant the Site admin user role with flood unblock ips...

  • Rajab Natshah committed 10d60a0f on 10.0.x
    Issue #3344805: Have translate any entity permission sat well in the...
rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Issue summary: View changes
Status: Active » Needs review
Issue tags: +varbase-10.0.0-alpha1, +varbase_core-10.0.0-alpha1
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: Unassigned » rajab natshah
Status: Closed (fixed) » Patch (to be ported)

To be back ported on the 9.0.x branch

  • Rajab Natshah committed 141b3d32 on 9.1.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed cb7bc34d on 9.0.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed 96b0f6f0 on 9.1.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...

  • Rajab Natshah committed f050ea7f on 9.0.x
    Issue #3344805: Add Permissions for user roles to Varbase Core from...
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Issue summary: View changes
Status: Patch (to be ported) » Fixed
Issue tags: +varbase-9.0.16, +varbase_core-9.1.0
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase_core-9.1.0

rajab natshah’s picture

Runtime Exception
Adding non-existent permissions to a role is not allowed. The incorrect permissions are "delete own page content", "edit own page content".

rajab natshah’s picture

Issue summary: View changes
Issue tags: +varbase_core-9.1.2
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

✅ Released varbase_core-9.1.2

rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-9.0.16

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.