mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
fix(group): add special flag to create method
To make the create method more consistent with the guidelines, this commit adds the `special` flag to the parameters. As this function will only be used to create the two hard-coded groups and to handle API requests at one or two places, adding the parameter should not be too problematic. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
d0239f3a24
commit
178513a3a0
5 changed files with 18 additions and 12 deletions
|
@ -265,28 +265,29 @@ describe('PermissionsService', () => {
|
|||
const everybody: Group = Group.create(
|
||||
SpecialGroup.EVERYONE,
|
||||
SpecialGroup.EVERYONE,
|
||||
true,
|
||||
) as Group;
|
||||
everybody.special = true;
|
||||
result[SpecialGroup.EVERYONE] = everybody;
|
||||
|
||||
const loggedIn = Group.create(
|
||||
SpecialGroup.LOGGED_IN,
|
||||
SpecialGroup.LOGGED_IN,
|
||||
true,
|
||||
) as Group;
|
||||
loggedIn.special = true;
|
||||
result[SpecialGroup.LOGGED_IN] = loggedIn;
|
||||
|
||||
const user1group = Group.create('user1group', 'user1group') as Group;
|
||||
const user1group = Group.create('user1group', 'user1group', false) as Group;
|
||||
user1group.members = [user1];
|
||||
result['user1group'] = user1group;
|
||||
|
||||
const user2group = Group.create('user2group', 'user2group') as Group;
|
||||
const user2group = Group.create('user2group', 'user2group', false) as Group;
|
||||
user2group.members = [user2];
|
||||
result['user2group'] = user2group;
|
||||
|
||||
const user1and2group = Group.create(
|
||||
'user1and2group',
|
||||
'user1and2group',
|
||||
false,
|
||||
) as Group;
|
||||
user1and2group.members = [user1, user2];
|
||||
result['user1and2group'] = user1and2group;
|
||||
|
@ -294,6 +295,7 @@ describe('PermissionsService', () => {
|
|||
const user2and1group = Group.create(
|
||||
'user2and1group',
|
||||
'user2and1group',
|
||||
false,
|
||||
) as Group;
|
||||
user2and1group.members = [user2, user1];
|
||||
result['user2and1group'] = user2and1group;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue