Add disable activity check option on certain roles #1078 (#1087)

* Add boolean field "disable activity checks" to role, check for this field inside PilotLeave-Check, add tests

* fix checkbox on form

* CS fixes

* CS fixes again :-)

Co-authored-by: Andreas Palm <ap@ewsp.de>
This commit is contained in:
exciler
2021-03-19 18:09:29 +01:00
committed by GitHub
parent 2cede04b1e
commit 9bb192b97f
7 changed files with 117 additions and 3 deletions

View File

@@ -370,5 +370,19 @@ class UserTest extends TestCase
$users_on_leave = $this->userSvc->findUsersOnLeave();
$this->assertEquals(0, count($users_on_leave));
// Check disable_activity_checks
$user = $this->createUser([
'status' => UserState::ACTIVE,
'created_at' => Carbon::now('UTC')->subDays(5),
]);
$role = $this->createRole([
'disable_activity_checks' => true,
]);
$user->attachRole($role);
$user->save();
$users_on_leave = $this->userSvc->findUsersOnLeave();
$this->assertEquals(0, count($users_on_leave));
}
}