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:
@@ -54,4 +54,9 @@ class User extends Authenticatable
|
||||
'role' => UserRole::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function canManageSettings(): bool
|
||||
{
|
||||
return $this->role === UserRole::ADMIN || $this->role === UserRole::MANAGER;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user