1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Protect document activity and revisions from external users

This commit is contained in:
Harvey Kandola 2018-07-18 12:43:49 -04:00
parent 6617a5de45
commit 50c7fabeb6
2 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,7 @@ export default Controller.extend(Tooltips, Notifier, {
tab: 'content',
queryParams: ['currentPageId'],
showRevisions: computed('permissions', 'document.protection', function() {
if (!this.get('session.viewUsers')) return false;
if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true;
if (this.get('document.protection') === this.get('constants').ProtectionType.Review && this.get('permissions.documentApprove')) return true;

View file

@ -79,6 +79,12 @@ export default SimpleAuthSession.extend({
this.get('session.content.authenticated.user.viewUsers') === true;
}),
viewUsers: computed('session.content.authenticated.user', function () {
return this.get('session.authenticator') !== 'authenticator:anonymous' &&
this.get('session.content.authenticated.user.id') !== '0' &&
this.get('session.content.authenticated.user.viewUsers') === true;
}),
init() {
this._super(...arguments);