Add role-based access control to management pages: implement canView method in ManageCtaSettings, ManagePortfolio, ManageSolutions, and ManageSuccess classes to restrict access to ADMIN and MANAGER roles, enhancing security and user experience.
This commit is contained in:
1 parent
a1826ae53c
commit
fe42967a74
6 files changed
+31
-1
No files matched your search
@@ -81,7 +81,11 @@ public function panel(Panel $panel): Panel
|
||||
public function boot(): void
|
||||
{
|
||||
Gate::before(function (User $user, string $ability) {
|
||||
return $user->role === UserRole::ADMIN ? true : null;
|
||||
if ($user->role === UserRole::ADMIN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
Gate::define('view-activity-logs', function (User $user) {
|
||||
|
||||
Reference in new issue
Block a user