feat: bpn as single source of truth for role and hotel code assignments
This commit is contained in:
@@ -231,6 +231,27 @@ class User implements UserInterface, TimestampableEntityInterface, SoftDeletable
|
||||
return array_values(array_intersect($this->roles, array_keys(self::ROLES)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The roles this user is nominated for but does not hold, as role => label.
|
||||
*
|
||||
* The markers are storage; this is what an approver acts on, so it is keyed by the real
|
||||
* role rather than by the marker standing in for it.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getNominatedRoles(): array
|
||||
{
|
||||
$roles = [];
|
||||
|
||||
foreach (self::PENDING_ROLES as $role => $pendingRole) {
|
||||
if (true === in_array($pendingRole, $this->roles, true)) {
|
||||
$roles[$role] = self::ROLES[$role];
|
||||
}
|
||||
}
|
||||
|
||||
return $roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pending markers currently held by the user.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user