Fix compliance page permission
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -282,6 +282,7 @@ var Permissions = map[uint16]map[Action][]Role{
|
|||||||
ActionListSnapshots: AllRoles,
|
ActionListSnapshots: AllRoles,
|
||||||
ActionListTrustCenterFiles: AllRoles,
|
ActionListTrustCenterFiles: AllRoles,
|
||||||
ActionGetTrustCenter: AllRoles,
|
ActionGetTrustCenter: AllRoles,
|
||||||
|
ActionAudit: AllRoles,
|
||||||
ActionGetCustomDomain: AllRoles,
|
ActionGetCustomDomain: AllRoles,
|
||||||
ActionListSAMLConfigurations: AllRoles,
|
ActionListSAMLConfigurations: AllRoles,
|
||||||
ActionConfirmEmail: AllRoles,
|
ActionConfirmEmail: AllRoles,
|
||||||
@@ -341,6 +342,9 @@ var Permissions = map[uint16]map[Action][]Role{
|
|||||||
ActionActiveCount: AllRoles,
|
ActionActiveCount: AllRoles,
|
||||||
ActionPendingRequestCount: AllRoles,
|
ActionPendingRequestCount: AllRoles,
|
||||||
ActionAvailableDocumentAccesses: AllRoles,
|
ActionAvailableDocumentAccesses: AllRoles,
|
||||||
|
ActionDocument: AllRoles,
|
||||||
|
ActionReport: AllRoles,
|
||||||
|
ActionTrustCenterFile: AllRoles,
|
||||||
|
|
||||||
ActionUpdateTrustCenterAccess: EditRoles,
|
ActionUpdateTrustCenterAccess: EditRoles,
|
||||||
ActionDeleteTrustCenterAccess: EditRoles,
|
ActionDeleteTrustCenterAccess: EditRoles,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ type (
|
|||||||
TrustCenterFile *TrustCenterFile `json:"trustCenterFile,omitempty"`
|
TrustCenterFile *TrustCenterFile `json:"trustCenterFile,omitempty"`
|
||||||
|
|
||||||
// Internal fields used by resolvers
|
// Internal fields used by resolvers
|
||||||
|
TrustCenterAccessID gid.GID `json:"-"`
|
||||||
DocumentID *gid.GID `json:"-"`
|
DocumentID *gid.GID `json:"-"`
|
||||||
ReportID *gid.GID `json:"-"`
|
ReportID *gid.GID `json:"-"`
|
||||||
TrustCenterFileID *gid.GID `json:"-"`
|
TrustCenterFileID *gid.GID `json:"-"`
|
||||||
@@ -61,6 +62,7 @@ func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *Tru
|
|||||||
Requested: tcda.Requested,
|
Requested: tcda.Requested,
|
||||||
CreatedAt: tcda.CreatedAt,
|
CreatedAt: tcda.CreatedAt,
|
||||||
UpdatedAt: tcda.UpdatedAt,
|
UpdatedAt: tcda.UpdatedAt,
|
||||||
|
TrustCenterAccessID: tcda.TrustCenterAccessID,
|
||||||
DocumentID: tcda.DocumentID,
|
DocumentID: tcda.DocumentID,
|
||||||
ReportID: tcda.ReportID,
|
ReportID: tcda.ReportID,
|
||||||
TrustCenterFileID: tcda.TrustCenterFileID,
|
TrustCenterFileID: tcda.TrustCenterFileID,
|
||||||
|
|||||||
@@ -6349,13 +6349,13 @@ func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Contex
|
|||||||
|
|
||||||
// Document is the resolver for the document field.
|
// Document is the resolver for the document field.
|
||||||
func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Document, error) {
|
func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Document, error) {
|
||||||
r.MustBeAuthorized(ctx, obj.ID, authz.ActionDocument)
|
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionDocument)
|
||||||
|
|
||||||
if obj.DocumentID == nil {
|
if obj.DocumentID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.TrustCenterAccessID.TenantID())
|
||||||
|
|
||||||
document, err := prb.Documents.Get(ctx, *obj.DocumentID)
|
document, err := prb.Documents.Get(ctx, *obj.DocumentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -6371,13 +6371,13 @@ 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.ID, authz.ActionReport)
|
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionReport)
|
||||||
|
|
||||||
if obj.ReportID == nil {
|
if obj.ReportID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.TrustCenterAccessID.TenantID())
|
||||||
|
|
||||||
report, err := prb.Reports.Get(ctx, *obj.ReportID)
|
report, err := prb.Reports.Get(ctx, *obj.ReportID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -6389,13 +6389,13 @@ 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.ID, authz.ActionTrustCenterFile)
|
r.MustBeAuthorized(ctx, obj.TrustCenterAccessID, authz.ActionTrustCenterFile)
|
||||||
|
|
||||||
if obj.TrustCenterFileID == nil {
|
if obj.TrustCenterFileID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.TrustCenterAccessID.TenantID())
|
||||||
|
|
||||||
trustCenterFile, err := prb.TrustCenterFiles.Get(ctx, *obj.TrustCenterFileID)
|
trustCenterFile, err := prb.TrustCenterFiles.Get(ctx, *obj.TrustCenterFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user