Skip to content

Commit

Permalink
Fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
fflorent committed Jan 11, 2025
1 parent 39f2479 commit 0dfc8f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 4 additions & 2 deletions app/gen-server/lib/homedb/GroupsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ export class GroupsManager {
this.defaultGroups.forEach(groupProps => {
if (!groupProps.orgOnly || !inherit) {
// Skip this group if it's an org only group and the resource inherits from a parent.
const group = new Group();
group.name = groupProps.name;
const group = Group.create({
name: groupProps.name,
type: Group.ROLE_TYPE,
});
if (inherit) {
this.setInheritance(group, inherit);
}
Expand Down
13 changes: 6 additions & 7 deletions test/gen-server/lib/homedb/UsersManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ describe('UsersManager', function () {
const entries = Object.entries(groupDefinition) as [NonGuestGroup['name'], User[] | undefined][];

return entries.map(([groupName, users], index) => {
const group = new Group() as NonGuestGroup;
group.id = index;
group.name = groupName;
if (users) {
group.memberUsers = users;
}
return group;
return Group.create({
id: index,
name: groupName,
type: Group.ROLE_TYPE,
memberUsers: users,
}) as NonGuestGroup;
});
}

Expand Down

0 comments on commit 0dfc8f4

Please sign in to comment.