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:
@@ -81,7 +81,11 @@ class PanelPanelProvider extends PanelProvider
|
||||
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