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:
parent
6617a5de45
commit
50c7fabeb6
2 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue