feat: more role backend and admin/writer roles additions and adjustments
This commit is contained in:
1 parent
8c6c6456da
commit
de142f6c5f
131 files changed
+2663
-435
No files matched your search
@@ -2,6 +2,7 @@ package useCases
|
||||
|
||||
import (
|
||||
"RenewCMS/internal/domain/audit"
|
||||
"RenewCMS/internal/domain/role"
|
||||
"encoding/csv"
|
||||
"io"
|
||||
"strings"
|
||||
@@ -29,11 +30,20 @@ func NewExportActivityUseCase(events audit.Repository, now func() time.Time) *Ex
|
||||
return &ExportActivityUseCase{events, now}
|
||||
}
|
||||
|
||||
func (e *ExportActivityUseCase) Prepare(query ActivityQuery) (*ActivityExport, error) {
|
||||
filter, err := buildActivityFilter(query, e.now())
|
||||
type ExportActivityCommand struct {
|
||||
ViewerID uint32
|
||||
Grants role.GrantSet
|
||||
Query ActivityQuery
|
||||
}
|
||||
|
||||
func (e *ExportActivityUseCase) Prepare(command ExportActivityCommand) (*ActivityExport, error) {
|
||||
filter, err := buildActivityFilter(command.Query, e.now())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := scopeFilterToViewer(&filter, command.ViewerID, command.Grants); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ActivityExport{events: e.events, filter: filter}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user