Fix permission for trust center access
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -45,6 +45,7 @@ const (
|
|||||||
ActionGetCustomDomain Action = "getCustomDomain"
|
ActionGetCustomDomain Action = "getCustomDomain"
|
||||||
ActionGetDataPrivacyAgreement Action = "getDataPrivacyAgreement"
|
ActionGetDataPrivacyAgreement Action = "getDataPrivacyAgreement"
|
||||||
ActionGetDocument Action = "getDocument"
|
ActionGetDocument Action = "getDocument"
|
||||||
|
ActionGetReport Action = "getReport"
|
||||||
ActionGetFile Action = "getFile"
|
ActionGetFile Action = "getFile"
|
||||||
ActionGetFileUrl Action = "getFileUrl"
|
ActionGetFileUrl Action = "getFileUrl"
|
||||||
ActionGetFramework Action = "getFramework"
|
ActionGetFramework Action = "getFramework"
|
||||||
@@ -351,6 +352,8 @@ var Permissions = map[uint16]map[Action][]Role{
|
|||||||
ActionActiveCount: NonEmployeeRoles,
|
ActionActiveCount: NonEmployeeRoles,
|
||||||
ActionPendingRequestCount: NonEmployeeRoles,
|
ActionPendingRequestCount: NonEmployeeRoles,
|
||||||
ActionAvailableDocumentAccesses: NonEmployeeRoles,
|
ActionAvailableDocumentAccesses: NonEmployeeRoles,
|
||||||
|
ActionGetTrustCenterFile: NonEmployeeRoles,
|
||||||
|
ActionGetReport: NonEmployeeRoles,
|
||||||
|
|
||||||
ActionUpdateTrustCenterAccess: EditRoles,
|
ActionUpdateTrustCenterAccess: EditRoles,
|
||||||
ActionDeleteTrustCenterAccess: EditRoles,
|
ActionDeleteTrustCenterAccess: EditRoles,
|
||||||
|
|||||||
@@ -6516,7 +6516,7 @@ func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *t
|
|||||||
|
|
||||||
// Report is the resolver for the report field.
|
// Report is the resolver for the report field.
|
||||||
func (r *trustCenterDocumentAccessResolver) Report(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Report, error) {
|
func (r *trustCenterDocumentAccessResolver) Report(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Report, error) {
|
||||||
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionReport)
|
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionGetReport)
|
||||||
|
|
||||||
if obj.ReportID == nil {
|
if obj.ReportID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
@@ -6534,7 +6534,7 @@ func (r *trustCenterDocumentAccessResolver) Report(ctx context.Context, obj *typ
|
|||||||
|
|
||||||
// TrustCenterFile is the resolver for the trustCenterFile field.
|
// TrustCenterFile is the resolver for the trustCenterFile field.
|
||||||
func (r *trustCenterDocumentAccessResolver) TrustCenterFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.TrustCenterFile, error) {
|
func (r *trustCenterDocumentAccessResolver) TrustCenterFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.TrustCenterFile, error) {
|
||||||
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionTrustCenterFile)
|
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionGetTrustCenterFile)
|
||||||
|
|
||||||
if obj.TrustCenterFileID == nil {
|
if obj.TrustCenterFileID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user