$component
$component : \Dewdrop\Admin\Component\ComponentAbstract
The component these permissions apply to.
This class allows you to adjust the permissions for an admin component. It allows you to disable or enable a permission globally, by role or by callback, much like the permissions-related methods on \Dewdrop\Fields\FieldInterface.
By default, there are only two very simple permissions available:
1) access: Can the user access this component at all?
2) display-menu: Should the component be shown in the main admin nav menu?
For component's implementing the CrudInterface, they get a number of additional permissions automatically.
For permissions specific to your component, call the register() method to add them.
$component : \Dewdrop\Admin\Component\ComponentAbstract
The component these permissions apply to.
registerAndSetDefaultsForCrudInterface(\Dewdrop\Admin\Component\CrudInterface $component) : $this
Register a number of permissions that we make available on CrudInterface components.
\Dewdrop\Admin\Component\CrudInterface | $component |
can(string $name, boolean $throwExceptionOnFail = false) : boolean
Check to see if the given permission is granted to the current user (or anonymous users, if no user resource is available in Pimple. You can optionally choose to just throw an exception to halt execution when the user doesn't have the requested permission. This can be convenient when the user can only reach the point where this permission is checked by circumventing the normal navigation provided in the UI (e.g. by manipulating the URL).
string | $name | |
boolean | $throwExceptionOnFail |