mirror of
https://github.com/documize/community.git
synced 2025-07-20 05:39:42 +02:00
Tidy up draft permission handling
Removes inconsistency of approvals vs. lifecycle.
This commit is contained in:
parent
2a45c82b46
commit
a710839f69
2 changed files with 4 additions and 14 deletions
|
@ -147,19 +147,9 @@ func (h *Handler) BySpace(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
// Get the space as we need to check settings.
|
||||
space, err := h.Store.Space.Get(ctx, spaceID)
|
||||
|
||||
// Can user view drafts?
|
||||
viewDrafts := permission.CanViewDrafts(ctx, *h.Store, spaceID)
|
||||
|
||||
// If space defaults to drfat documents, then this means
|
||||
// user can view drafts as long as they have edit rights.
|
||||
canEdit := permission.HasPermission(ctx, *h.Store, spaceID, pm.DocumentEdit)
|
||||
if space.Lifecycle == workflow.LifecycleDraft && canEdit {
|
||||
viewDrafts = true
|
||||
}
|
||||
|
||||
// Get complete list of documents regardless of category permission
|
||||
// and versioning.
|
||||
documents, err := h.Store.Document.GetBySpace(ctx, spaceID)
|
||||
|
|
|
@ -46,9 +46,9 @@
|
|||
<div class="perm-name">Templates</div>
|
||||
<div class="perm-desc">Can create and publish document templates</div>
|
||||
<div class="perm-name">Approval</div>
|
||||
<div class="perm-desc">Can approve or reject document content changes</div>
|
||||
<div class="perm-name">Lifecycle</div>
|
||||
<div class="perm-desc">Can mark documents as Draft, Live and Archived</div>
|
||||
<div class="perm-desc">Can approve or reject document content changes, move drafts to live.</div>
|
||||
<div class="perm-name">Drafts</div>
|
||||
<div class="perm-desc">Can view and work on documents marked as draft</div>
|
||||
<div class="perm-name">Versions</div>
|
||||
<div class="perm-desc">Can create document version and link them together</div>
|
||||
</div>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<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">Drafts</th>
|
||||
<th class="text-info">Versions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue