mirror of
https://github.com/documize/community.git
synced 2025-08-05 21:45:28 +02:00
refactored permission code
This commit is contained in:
parent
c12c000ef3
commit
6a651770b5
24 changed files with 753 additions and 632 deletions
|
@ -22,7 +22,7 @@ import (
|
|||
"github.com/documize/community/core/streamutil"
|
||||
"github.com/documize/community/core/uniqueid"
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/document"
|
||||
"github.com/documize/community/domain/permission"
|
||||
"github.com/documize/community/model/audit"
|
||||
"github.com/documize/community/model/block"
|
||||
)
|
||||
|
@ -57,7 +57,7 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if !document.CanUploadDocument(ctx, *h.Store, b.LabelID) {
|
||||
if !permission.CanUploadDocument(ctx, *h.Store, b.LabelID) {
|
||||
response.WriteForbiddenError(w)
|
||||
return
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
b.RefID = blockID
|
||||
|
||||
if !document.CanUploadDocument(ctx, *h.Store, b.LabelID) {
|
||||
if !permission.CanUploadDocument(ctx, *h.Store, b.LabelID) {
|
||||
response.WriteForbiddenError(w)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue