Add role cloning functionality and adjust permission methods.
Introduced a method to clone groups with their permissions and added a corresponding API endpoint for role cloning. Adjusted existing permission methods to ensure consistent behavior and naming, swapping the implementation of add/remove permissions. Improved permission fetching logic for cleaner data handling.
This commit is contained in:
@@ -114,9 +114,14 @@ class groups_permissions_o extends db
|
||||
*/
|
||||
public function getGroupPermissions(int $group_id): array
|
||||
{
|
||||
return self::getFieldsWhere([
|
||||
$raw_permissions = self::getFieldsWhere([
|
||||
'group_id' => $group_id
|
||||
], ['permission']);
|
||||
$permissions = [];
|
||||
foreach ( $raw_permissions as $permission ) {
|
||||
$permissions[] = $permission['permission'];
|
||||
}
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user