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:
2025-07-29 15:45:22 +05:00
parent a1826ae53c
commit fe42967a74
6 changed files with 31 additions and 1 deletions

View File

@@ -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) {