Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
block_region_permissions-3438028
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
block_region_permissions-3438028
Commits
30b33ddd
Commit
30b33ddd
authored
7 years ago
by
Joshua Roberson
Browse files
Options
Downloads
Patches
Plain Diff
Code Sniffer fixes
parent
a22cf017
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
block_region_permissions.module
+2
-2
2 additions, 2 deletions
block_region_permissions.module
src/Routing/RouteSubscriber.php
+4
-4
4 additions, 4 deletions
src/Routing/RouteSubscriber.php
with
6 additions
and
6 deletions
block_region_permissions.module
+
2
−
2
View file @
30b33ddd
...
@@ -28,8 +28,8 @@ function block_region_permissions_form_block_admin_display_form_alter(&$form, Fo
...
@@ -28,8 +28,8 @@ function block_region_permissions_form_block_admin_display_form_alter(&$form, Fo
// Get block keys for each region.
// Get block keys for each region.
// Also get a master list of region select field options.
// Also get a master list of region select field options.
$region_block_keys
=
array
()
;
$region_block_keys
=
[]
;
$region_options
=
array
()
;
$region_options
=
[]
;
$block_elements
=
Element
::
children
(
$form
[
'blocks'
]);
$block_elements
=
Element
::
children
(
$form
[
'blocks'
]);
foreach
(
$block_elements
as
$block_key
)
{
foreach
(
$block_elements
as
$block_key
)
{
// Get region name.
// Get region name.
...
...
This diff is collapsed.
Click to expand it.
src/Routing/RouteSubscriber.php
+
4
−
4
View file @
30b33ddd
...
@@ -15,15 +15,15 @@ class RouteSubscriber extends RouteSubscriberBase {
...
@@ -15,15 +15,15 @@ class RouteSubscriber extends RouteSubscriberBase {
*/
*/
public
function
alterRoutes
(
RouteCollection
$collection
)
{
public
function
alterRoutes
(
RouteCollection
$collection
)
{
// Change access callback for the block edit and delete forms.
// Change access callback for the block edit and delete forms.
$routeNames
=
array
(
$routeNames
=
[
'entity.block.edit_form'
,
'entity.block.edit_form'
,
'entity.block.delete_form'
,
'entity.block.delete_form'
,
)
;
]
;
foreach
(
$routeNames
as
$name
)
{
foreach
(
$routeNames
as
$name
)
{
if
(
$route
=
$collection
->
get
(
$name
))
{
if
(
$route
=
$collection
->
get
(
$name
))
{
$route
->
addRequirements
(
array
(
$route
->
addRequirements
(
[
'_custom_access'
=>
'Drupal\block_region_permissions\AccessControlHandler::blockFormAccess'
,
'_custom_access'
=>
'Drupal\block_region_permissions\AccessControlHandler::blockFormAccess'
,
)
);
]
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment