Skip to content

Commit

Permalink
Rename route and access controller action
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Jan 17, 2018
1 parent 69d5bdf commit 7dc7c0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions bundle/Controller/Admin/AccessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
class AccessController extends Controller
{
/**
* Returns ez:tags:add flag for "Add new tag" button visibility
* Returns if current user has access to tags/add policy.
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
*/
public function getAddPermissionFlagAction()
public function canAddTagsAction()
{
return new JsonResponse($this->isGranted('ez:tags:add'));
}

}
}
2 changes: 1 addition & 1 deletion bundle/PlatformUI/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getConfig()
'autoCompleteLimit' => $this->configResolver->getParameter('field.autocomplete_limit', 'eztags'),
'urls' => array(
'autoComplete' => $this->urlGenerator->generate('netgen_tags_admin_field_autocomplete'),
'addTagButtonVisibility' => $this->urlGenerator->generate('netgen_tags_admin_add_tag_button_visibility'),
'addTagButtonVisibility' => $this->urlGenerator->generate('netgen_tags_admin_access_add_tags'),
'treeChildren' => $this->urlGenerator->generate(
'netgen_tags_admin_tree_get_children',
array(
Expand Down
4 changes: 2 additions & 2 deletions bundle/Resources/config/routing/admin/field.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ netgen_tags_admin_field_autocomplete:
_controller: eztags.admin.controller.field:autoCompleteAction
_method: GET

netgen_tags_admin_add_tag_button_visibility:
netgen_tags_admin_access_add_tags:
path: /access/add
defaults:
_controller: eztags.admin.controller.access:getAddPermissionFlagAction
_controller: eztags.admin.controller.access:canAddTagsAction
_method: GET

netgen_tags_admin_field_children:
Expand Down

0 comments on commit 7dc7c0f

Please sign in to comment.