1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 08:09:43 +02:00
documize/gui/app/templates/components/folder/settings-permissions.hbs
2018-06-05 14:04:14 +01:00

113 lines
5 KiB
Handlebars

<div class="content-zone">
<div class="explainer-header">Space and document permissions for both users and groups</div>
<p class="explainer-text">Space level permissions:</p>
<ul class="explainer-list">
<li>View &mdash; see content within this space</li>
<li>Manage &mdash; manage all aspects of space except deletion</li>
<li>Owner &mdash; manage and delete space</li>
</ul>
<p class="explainer-text">Document level permissions:</p>
<ul class="explainer-list explainer-gap">
<li>Create &mdash; create new documents</li>
<li>Edit &mdash; edit documents</li>
<li>Delete &mdash; delete documents</li>
<li>Move &mdash; move content between documents</li>
<li>Copy &mdash; copy content between documents</li>
<li>Templates &mdash; create, edit, delete document templates and content blocks</li>
<li>Approval &mdash; approve or reject content changes</li>
<li>Lifecycle &mdash; mark documents as Draft, Live or Archived</li>
<li>Versions &mdash; create versions of documents (baselining)</li>
</ul>
</div>
<div class="space-admin table-responsive">
<table class="table table-hover permission-table mb-3">
<thead>
<tr>
<th></th>
<th colspan="3">Spaces</th>
<th colspan="9" class="text-info">Documents</th>
</tr>
<tr>
<th></th>
<th>View</th>
<th>Manage</th>
<th>Owner</th>
<th class="text-info">Create</th>
<th class="text-info">Edit</th>
<th class="text-info">Delete</th>
<th class="text-info">Move</th>
<th class="text-info">Copy</th>
<th class="text-info">Templates</th>
<th class="text-info">Approval</th>
<th class="text-info">Lifecycle</th>
<th class="text-info">Versions</th>
</tr>
</thead>
<tbody>
{{#each spacePermissions as |permission|}}
<tr>
<td>
{{#if (eq permission.who "role")}}
<span class="button-icon-blue button-icon-small align-middle">
<i class="material-icons">people</i>
</span>
<span class="color-blue">&nbsp;{{permission.name}}
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
</span>
{{else}}
{{#if (eq permission.whoId constants.EveryoneUserId)}}
<span class="button-icon-green button-icon-small align-middle">
<i class="material-icons">language</i>
</span>
<span class="color-green">&nbsp;{{permission.name}}</span>
{{else}}
<span class="button-icon-gray button-icon-small align-middle">
<i class="material-icons">person</i>
</span>
<span class="">&nbsp;{{permission.name}}
{{#if (eq permission.whoId session.user.id)}}
<small class="form-text text-muted d-inline-block">(you)</small>
{{/if}}
</span>
{{/if}}
{{/if}}
</td>
<td>{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-template-' permission.whoId) checked=permission.documentTemplate}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-approve-' permission.whoId) checked=permission.documentApprove}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-lifecycle-' permission.whoId) checked=permission.documentLifecycle}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-version-' permission.whoId) checked=permission.documentVersion}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
<button type="button" class="btn btn-success my-3" onclick= {{action 'onSave'}}>Save</button>
<div class="container-fluid mt-5">
<div class="row justify-content-center">
<div class="col-6">
<div class="form-group">
{{focus-input id="user-search" type="text" class="form-control mousetrap" placeholder="Search for users by firstname, lastname, email" value=searchText key-up=(action 'onSearch')}}
<small class="form-text text-muted">Find and add users to this space</small>
</div>
{{#each filteredUsers as |user|}}
<div class="row my-3">
<div class="col-10">{{user.fullname}}</div>
<div class="col-2 text-right">
<button class="btn btn-primary" {{action 'onAdd' user}}>Add</button>
</div>
</div>
{{/each}}
</div>
</div>
</div>