-
Notifications
You must be signed in to change notification settings - Fork 0
Authorization
KroderDev edited this page Jul 1, 2025
·
3 revisions
The package integrates with Laravel's Gate, enabling Blade directives to check roles and permissions.
@can('posts.create')
<!-- user can create posts -->
@endcan
@cannot('permission:posts.delete')
<!-- no delete rights -->
@endcannot
@canany(['role:admin', 'permission:posts.update'])
<!-- admin or user with update permission -->
@endcanany
Use hasRole
and hasPermissionTo
methods on the authenticated user for programmatic checks:
if (auth()->user()->hasRole('admin')) {
// ...
}
Authentication is handled via JWT tokens validated by the JWT Authentication middleware or by the session-based Gateway Guard.
Refer to the linked pages for configuration details.
Maintained by @KroderDev
💬 Feedback? Open an issue
Last updated: July 1, 2025