Added svg icons, currently only for items

This commit is contained in:
Stefan Zermatten
2020-05-30 18:04:48 +02:00
parent 8138cd98f1
commit 060c44f384
19 changed files with 897 additions and 590 deletions

View File

@@ -113,3 +113,17 @@ export function assertDocViewPermission(doc, userId){
let root = getRoot(doc);
assertViewPermission(root, userId);
}
export function assertAdmin(userId){
assertIdValid(userId);
let user = Meteor.users.findOne(userId, {fields: {roles: 1}});
if (!user){
throw new Meteor.Error('Permission denied',
'UserId does not match any existing user');
}
let isAdmin = user.roles && user.roles.includes('admin')
if (!isAdmin){
throw new Meteor.Error('Permission denied',
'User does not have the admin role');
}
}