mirror of
https://github.com/documize/community.git
synced 2025-07-21 22:29:41 +02:00
using all new permissions for securing spaces and documents
WIP
This commit is contained in:
parent
ef285c91de
commit
300b617583
51 changed files with 517 additions and 868 deletions
|
@ -32,7 +32,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didReceiveAttrs: function () {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 0);
|
||||
|
||||
if (is.not.null(this.get('currentPageId'))) {
|
||||
|
@ -42,7 +42,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didRender: function () {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
if (this.session.authenticated) {
|
||||
this.addTooltip(document.getElementById("toc-up-button"));
|
||||
this.addTooltip(document.getElementById("toc-down-button"));
|
||||
|
@ -53,13 +53,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
this.eventBus.unsubscribe('documentPageAdded');
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
@ -77,7 +77,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
let page = _.findWhere(toc, { id: pageId });
|
||||
let state = tocUtil.getState(toc, page);
|
||||
|
||||
if (!this.get('isEditor') || is.empty(pageId)) {
|
||||
if (!this.get('permissions.documentEdit') || is.empty(pageId)) {
|
||||
state.actionablePage = false;
|
||||
state.upDisabled = state.downDisabled = state.indentDisabled = state.outdentDisabled = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue