Updated frontend
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
'use static';
|
||||
'use strict';
|
||||
|
||||
const {Group} = require('../models/group_ldap');
|
||||
|
||||
let byGroup = async function(user, groups, ownerOf){
|
||||
for(let group of groups){
|
||||
try{
|
||||
console.log('checking group', group, 'for access', groups, ownerOf)
|
||||
group = await Group.get(group);
|
||||
if(group.member.includes(user.dn)) return true
|
||||
}catch(error){
|
||||
console.error('Error byGroup', groups, ownerOf);
|
||||
// group not found, continue checking
|
||||
}
|
||||
}
|
||||
|
||||
for(let group of ownerOf || []){
|
||||
try{
|
||||
console.log('checking group owners', group, 'for access', groups, ownerOf)
|
||||
|
||||
group = await Group.get(group);
|
||||
if(group.owner.includes(user.dn)) return true
|
||||
}catch(error){
|
||||
console.error('Error byGroup', groups, ownerOf);
|
||||
// group not found, continue checking
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user