Take contact shares into account for push ACL checks

This commit is contained in:
nathangray
2021-02-24 14:28:17 -07:00
parent 1f41bba904
commit 158e65fc90
5 changed files with 59 additions and 12 deletions

View File

@ -329,14 +329,25 @@ export abstract class EgwApp
{
let grants = egw.grants(this.appname);
// No grants known
if(!grants) return true;
// check user has a grant from owner or something
for(let i = 0; i < grant_fields.length; i++)
{
if(grants && typeof grants[pushData.acl[grant_fields[i]]] !== 'undefined')
let grant_field = pushData.acl[grant_fields[i]];
if(["number","string"].indexOf(typeof grant_field) >=0 && grants[grant_field] !== 'undefined')
{
// ACL access
return true;
}
else if(!Object.keys(grants).filter(function(grant_account) {
return grant_field.indexOf(grant_account) >= 0 ||
grant_field.indexOf(parseInt(grant_account)).length
}))
{
return false;
}
}
return false;
}