Add role-based access control to various settings pages: implement canAccess method in AboutPageSettings, ContactPageSettings, HomePageSettings, ManageCtaSettings, ManagePortfolio, ManageSite, ManageSiteSocialSettings, ManageSolutions, ManageSuccess, and update User model to include canManageSettings method for enhanced security and user experience.

This commit is contained in:
2025-07-29 15:54:16 +05:00
parent 3e80ea4d5e
commit 643ccd6d9e
16 changed files with 83 additions and 27 deletions

View File

@@ -54,4 +54,9 @@ class User extends Authenticatable
'role' => UserRole::class,
];
}
public function canManageSettings(): bool
{
return $this->role === UserRole::ADMIN || $this->role === UserRole::MANAGER;
}
}