Roles & Permissions
Sunshine roles management is based on Symfony roles. You should define roles withing your symfony application. Theses roles will then be available to restrict access to sunshine elements.
Access Restriction based on roles and roles permissions
Menu
You may need to configure menu items to be available only for specific users based on their roles and/or permissions. You may achieve this by adding a security parameter for each menu item you want to control access to. See example below :
Sample menu configuration :
With this configuration, the menu entry 'Mensuel' will only be shown to users with the role 'ROLE_ADMIN' Note that you can give an array of authorized roles.
Page
In the page configuration, you can add a list of roles who can access to the page. Persons who doesn't have the role, will receive a Access Denied Exception.
In this configuration, users without ROLE_ADMIN role will receive the Exception. Note that you can give an array of authorized roles.
Widget
In the widget configuration, you can add a list of roles who can see the widget.
In this configuration, users without the ROLE_USER will not see the widget.
AnyWhere else...
Last updated