Skip to content

Commit e79bf78

Browse files
committed
feat: add GroupModel::isValidGroup()
1 parent 4cac2d8 commit e79bf78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Models/GroupModel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,14 @@ public function deleteNotIn($userId, $cache): void
7373

7474
$this->checkQueryReturn($return);
7575
}
76+
77+
/**
78+
* @param non-empty-string $group Group name
79+
*/
80+
public function isValidGroup(string $group): bool
81+
{
82+
$allowedGroups = array_keys(setting('AuthGroups.groups'));
83+
84+
return (bool) (in_array($group, $allowedGroups, true));
85+
}
7686
}

0 commit comments

Comments
 (0)