mirror of
https://github.com/documize/community.git
synced 2025-08-05 13:35:25 +02:00
Fix an issue with Everyone permissions not being observed
This commit is contained in:
parent
91bab8c710
commit
9d8b1d2f3c
19 changed files with 102 additions and 94 deletions
|
@ -18,9 +18,6 @@ export default Component.extend({
|
|||
documentService: service('document'),
|
||||
appMeta: service(),
|
||||
hasAttachments: notEmpty('files'),
|
||||
canShow: computed('permissions', 'files', function() {
|
||||
return this.get('files.length') > 0 || this.get('permissions.documentEdit');
|
||||
}),
|
||||
canEdit: computed('permissions', 'document.protection', function() {
|
||||
return this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
|
||||
}),
|
||||
|
|
|
@ -114,7 +114,7 @@ export default Component.extend({
|
|||
$(".stage-3").fadeIn();
|
||||
// $("#spinner-1").show();
|
||||
|
||||
var payload = '{ "Password": "' + $("#stage-2-password").val() + '", "Serial": "' + self.serial + '", "Firstname": "' + $("#stage-1-firstname").val() + '", "Lastname": "' + $("#stage-1-lastname").val() + '" }';
|
||||
var payload = '{ "password": "' + $("#stage-2-password").val() + '", "serial": "' + self.serial + '", "firstname": "' + $("#stage-1-firstname").val() + '", "lastname": "' + $("#stage-1-lastname").val() + '" }';
|
||||
var password = $("#stage-2-password").val();
|
||||
|
||||
self.get('folderService').onboard(self.folderId, payload).then(function(user) {
|
||||
|
|
|
@ -57,7 +57,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.modalInputFocus('#document-template-modal', '#new-template-name');
|
||||
},
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div class="row no-gutters mb-5">
|
||||
<div class="col-12">
|
||||
<div class="text-center non-printable document-tabnav">
|
||||
<ul class="tabnav-control">
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
// https://documize.com
|
||||
|
||||
import { htmlSafe } from '@ember/string';
|
||||
|
||||
import { resolve } from 'rsvp';
|
||||
import Service, { inject as service } from '@ember/service';
|
||||
import config from '../config/environment';
|
||||
|
|
|
@ -95,7 +95,7 @@ export default BaseService.extend({
|
|||
});
|
||||
},
|
||||
|
||||
// reloads and caches folders.
|
||||
// reloads and caches folders
|
||||
reload() {
|
||||
return this.get('ajax').request(`space`, {
|
||||
method: "GET"
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
{{#if canShow}}
|
||||
<div class="view-attachment mt-5">
|
||||
{{#if hasAttachments}}
|
||||
<ul class="list">
|
||||
{{#each files key="id" as |a index|}}
|
||||
<li class="item">
|
||||
<img class="icon" src="/assets/img/attachments/{{document/file-icon a.extension}}" />
|
||||
<a href="{{appMeta.endpoint}}/public/attachments/{{appMeta.orgId}}/{{a.id}}">
|
||||
<span class="file">{{ a.filename }}</span>
|
||||
</a>
|
||||
{{#if canEdit}}
|
||||
<div class="button-icon-danger align-middle action" {{action 'onShowDialog' a.id a.filename}}>
|
||||
<i class="material-icons">delete</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{#if canEdit}}
|
||||
<div class="upload-document-files">
|
||||
<div id="upload-document-files" class="btn btn-secondary">Upload</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="view-attachment mt-5">
|
||||
{{#if hasAttachments}}
|
||||
<ul class="list">
|
||||
{{#each files key="id" as |a index|}}
|
||||
<li class="item">
|
||||
<img class="icon" src="/assets/img/attachments/{{document/file-icon a.extension}}" />
|
||||
<a href="{{appMeta.endpoint}}/public/attachments/{{appMeta.orgId}}/{{a.id}}">
|
||||
<span class="file">{{ a.filename }}</span>
|
||||
</a>
|
||||
{{#if canEdit}}
|
||||
<div class="button-icon-danger align-middle action" {{action 'onShowDialog' a.id a.filename}}>
|
||||
<i class="material-icons">delete</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{else}}
|
||||
<p>No attachments found</p>
|
||||
{{/if}}
|
||||
{{#if canEdit}}
|
||||
<div class="upload-document-files">
|
||||
<div id="upload-document-files" class="btn btn-secondary">Upload</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonType="btn-danger" show=showDialog onAction=(action 'onDelete')}}
|
||||
<p>Are you sure you want to delete {{deleteAttachment.name}}?</p>
|
||||
{{/ui/ui-dialog}}
|
||||
{{/if}}
|
||||
{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonType="btn-danger" show=showDialog onAction=(action 'onDelete')}}
|
||||
<p>Are you sure you want to delete {{deleteAttachment.name}}?</p>
|
||||
{{/ui/ui-dialog}}
|
||||
|
|
|
@ -18,30 +18,31 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<div id="restore-history-button" class="btn btn-danger" data-toggle="modal" data-target="#document-rollback-modal" data-backdrop="static">Restore to this version</div>
|
||||
{{#if permissions.documentEdit}}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<div id="restore-history-button" class="btn btn-danger" data-toggle="modal" data-target="#document-rollback-modal" data-backdrop="static">Restore to this version</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="document-rollback-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Restore Document Section</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to roll back to this revision?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onRollback'}}>Restore</button>
|
||||
<div id="document-rollback-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Restore Document Section</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to roll back to this revision?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onRollback'}}>Restore</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p>No revisions made</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue