diff --git a/lib/user/v2/privilege/SimplePathPrivilegeManager.js b/lib/user/v2/privilege/SimplePathPrivilegeManager.js index 3a0b739b..2c72a5ff 100644 --- a/lib/user/v2/privilege/SimplePathPrivilegeManager.js +++ b/lib/user/v2/privilege/SimplePathPrivilegeManager.js @@ -42,6 +42,25 @@ var SimplePathPrivilegeManager = (function (_super) { throw Errors_1.Errors.IllegalArguments; if (!this.rights[user.uid]) this.rights[user.uid] = {}; + var rs = rights; + if (rs.indexOf('canRead') !== -1) { + rs.push('canReadLocks'); + rs.push('canReadContent'); + rs.push('canReadProperties'); + } + if (rs.indexOf('canReadContent') !== -1) { + rs.push('canReadContentTranslated'); + rs.push('canReadContentSource'); + } + if (rs.indexOf('canWrite') !== -1) { + rs.push('canWriteLocks'); + rs.push('canWriteContent'); + rs.push('canWriteProperties'); + } + if (rs.indexOf('canWriteContent') !== -1) { + rs.push('canWriteContentTranslated'); + rs.push('canWriteContentSource'); + } this.rights[user.uid][standarizePath(path)] = rights; }; SimplePathPrivilegeManager.prototype.getRights = function (user, path) { diff --git a/src/user/v2/privilege/SimplePathPrivilegeManager.ts b/src/user/v2/privilege/SimplePathPrivilegeManager.ts index 1ddd1eaf..7d304b43 100644 --- a/src/user/v2/privilege/SimplePathPrivilegeManager.ts +++ b/src/user/v2/privilege/SimplePathPrivilegeManager.ts @@ -45,6 +45,31 @@ export class SimplePathPrivilegeManager extends PrivilegeManager if(!this.rights[user.uid]) this.rights[user.uid] = {}; + + const rs = rights as string[]; + if(rs.indexOf('canRead') !== -1) + { + rs.push('canReadLocks'); + rs.push('canReadContent'); + rs.push('canReadProperties'); + } + if(rs.indexOf('canReadContent') !== -1) + { + rs.push('canReadContentTranslated'); + rs.push('canReadContentSource'); + } + + if(rs.indexOf('canWrite') !== -1) + { + rs.push('canWriteLocks'); + rs.push('canWriteContent'); + rs.push('canWriteProperties'); + } + if(rs.indexOf('canWriteContent') !== -1) + { + rs.push('canWriteContentTranslated'); + rs.push('canWriteContentSource'); + } this.rights[user.uid][standarizePath(path)] = rights; }