Skip to content
Snippets Groups Projects

Issue #3350210: Enable the Manage Permissions tab

3 unresolved threads

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Ready to merge by members who can write to the target branch.
  • The source branch is 49 commits behind the target branch.
  • 2 commits and 1 merge commit will be added to .
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
93 94
94 95 return $permissions[$account->id()][$type][$op];
95 96 }
97
98 /**
99 * Implements hook_entity_type_alter().
100 */
101 function paragraphs_type_permissions_entity_type_alter(array &$entity_types) {
102 $providers = $entity_types['paragraphs_type']->getRouteProviderClasses() ?: [];
103 if (empty($providers['permissions'])) {
104 $providers['permissions'] = EntityPermissionsRouteProvider::class;
105 $entity_types['paragraphs_type']->setHandlerClass('route_provider', $providers);
106 if (!$entity_types['paragraphs_type']->hasLinkTemplate('entity-permissions-form')) {
107 $entity_types['paragraphs_type']->setLinkTemplate('entity-permissions-form', '/admin/structure/paragraphs_type/{paragraphs_type}/permissions');
  • 55 55 $type_id = $type->id();
    56 56 $type_params = array('%type_name' => $type->label());
    57 57
    58 return array(
    59 'view paragraph content ' .$type_id => array(
    58 $permissions = [
    59 'view paragraph content ' .$type_id => [
    • Comment on lines +58 to +59
      Suggested change
      58 $permissions = [
      59 'view paragraph content ' .$type_id => [
      58 $permissions = [
      59 'view paragraph content ' . $type_id => [

      Personally, I prefer to interpolate, as you did on Line 80: "view paragraph content $type_id".

      It is debatable whether to fix coding standards (like changing from long array syntax to short) as part of this issue. But I will let the maintainers decide that. If we are going to clean up these lines, let's insert the missing space.

    • igor mashevskyi changed this line in version 2 of the diff

      changed this line in version 2 of the diff

    • Please register or sign in to reply
  • 39 39 $perms += $this->buildPermissions($type);
    40 40 }
    41 41
    42 42 return $perms;
  • igor mashevskyi added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading