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:
nurmuhammet committed 2025-07-29 15:45:22 +05:00
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) {