Force active flag to be returned as true or false

This commit is contained in:
Brady Wetherington 2023-11-23 16:34:03 +00:00
parent 0d29ac9856
commit 7b12d511f8

View file

@ -129,8 +129,20 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig
'preferredLanguage' => AttributeMapping::eloquent('locale'), // Section 5.3.5 of [RFC7231]
'locale' => null, // see RFC5646
'timezone' => null, // see RFC6557
'active' => AttributeMapping::eloquent('activated'),
'active' => (new AttributeMapping())->setAdd(
function ($value, &$object) {
$object->activated = $value;
}
)->setReplace(
function ($value, &$object) {
$object->activated = $value;
}
)->setRead(
// this works as specified.
function (&$object) {
return (bool)$object->activated;
}
),
'password' => AttributeMapping::eloquent('password')->disableRead(),
// Multi-Valued Attributes