0
votes

I have followed the static permission for my module in drupal 8 and adding

csv_custom test_permission:
    title: 'CSV_Custom'
    description: 'CSV_Custom The description'

in my permissions.yml (tried to add restrict access: TRUE and False)

and also

csv_custom.admin_settings:

  path: '/admin/config/csv_custom'

  defaults:

    _form: '\Drupal\csv_custom\Form\jsonForm'

    _title: 'Json Form'

  requirements:

    _permission: 'csv_custom test_permission'

in my routing.yml

It does show up a page where i can edit permission, however when I logged in with the user role, it still shows restricted access. Any help would be appreciated !

1

1 Answers

0
votes

For example you have a role

editor

and you want every user with this role is able to view the page

/admin/config/csv_custom

then set permission for this role at this page

/admin/people/permissions/editor

find your custom permission

csv_custom test_permission

and set check box checked and save now every user who have this role "editor" has permission to view/go to the page

/admin/config/csv_custom

Hope this make some sense for you thanks