- Add SendSmsMessage class for encapsulating SMS message data. - Create KavehNegarProvider and RanginehProvider classes implementing SmsProviderInterface for sending SMS. - Implement SmsLogRepository and SmsTemplateRepository for managing SMS logs and templates. - Develop SendSmsHandler for handling SMS sending messages. - Create SmsService to manage SMS dispatching and logging. - Add UserProfileController for managing user profiles with CRUD operations. - Implement UserProfile entity and repository for user profile data management. - Update symfony.lock and bootstrap.php for project dependencies and environment setup.
29 lines
724 B
PHP
29 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Secretary\Security;
|
|
|
|
use App\Secretary\Entity\DoctorSecretary;
|
|
|
|
class SecretaryPermissionChecker
|
|
{
|
|
public function can(DoctorSecretary $secretary, string $resource, string $action): bool
|
|
{
|
|
if (!$secretary->isActive()) {
|
|
return false;
|
|
}
|
|
|
|
$permissions = $secretary->getPermissions();
|
|
|
|
return (bool) ($permissions['resources'][$resource][$action] ?? false);
|
|
}
|
|
|
|
public function canAll(DoctorSecretary $secretary, string $resource, array $actions): bool
|
|
{
|
|
return array_reduce(
|
|
$actions,
|
|
fn(bool $carry, string $action) => $carry && $this->can($secretary, $resource, $action),
|
|
true
|
|
);
|
|
}
|
|
}
|