Redo export RBAC rules
This commit is contained in:
parent
7546d40ae9
commit
a1484098f0
@ -99,7 +99,6 @@ chart: {
|
||||
"read": {}
|
||||
"update": {}
|
||||
"delete": {}
|
||||
"export": description: "Access to export charts"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -118,7 +118,6 @@ module: {
|
||||
"read": {}
|
||||
"update": {}
|
||||
"delete": {}
|
||||
"export": description: "Access to export modules"
|
||||
"record.create": description: "Create record"
|
||||
"owned-record.create": description: "Create record with custom owner"
|
||||
"records.search": description: "List, search or filter records"
|
||||
|
||||
@ -87,7 +87,6 @@ namespace: {
|
||||
"charts.export": description: "Export charts on namespace"
|
||||
"page.create": description: "Create page on namespace"
|
||||
"pages.search": description: "List, search or filter pages on namespace"
|
||||
"pages.export": description: "Export pages on namespace"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,6 @@ page: {
|
||||
"read": {}
|
||||
"update": {}
|
||||
"delete": {}
|
||||
"export": description: "Access to export pages"
|
||||
"page-layout.create": description: "Create page layout on namespace"
|
||||
"page-layouts.search": description: "List, search or filter page layouts on namespace"
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ type (
|
||||
|
||||
CanGrant bool `json:"canGrant"`
|
||||
CanUpdateChart bool `json:"canUpdateChart"`
|
||||
CanExportChart bool `json:"canExportChart"`
|
||||
CanDeleteChart bool `json:"canDeleteChart"`
|
||||
}
|
||||
|
||||
@ -43,7 +42,6 @@ type (
|
||||
CanGrant(context.Context) bool
|
||||
|
||||
CanUpdateChart(context.Context, *types.Chart) bool
|
||||
CanExportChart(context.Context, *types.Chart) bool
|
||||
CanDeleteChart(context.Context, *types.Chart) bool
|
||||
}
|
||||
)
|
||||
@ -156,7 +154,6 @@ func (ctrl Chart) makePayload(ctx context.Context, c *types.Chart, err error) (*
|
||||
CanGrant: ctrl.ac.CanGrant(ctx),
|
||||
|
||||
CanUpdateChart: ctrl.ac.CanUpdateChart(ctx, c),
|
||||
CanExportChart: ctrl.ac.CanExportChart(ctx, c),
|
||||
CanDeleteChart: ctrl.ac.CanDeleteChart(ctx, c),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -24,7 +24,6 @@ type (
|
||||
Fields []*moduleFieldPayload `json:"fields"`
|
||||
|
||||
CanGrant bool `json:"canGrant"`
|
||||
CanExport bool `json:"canExport"`
|
||||
CanUpdateModule bool `json:"canUpdateModule"`
|
||||
CanDeleteModule bool `json:"canDeleteModule"`
|
||||
CanCreateRecord bool `json:"canCreateRecord"`
|
||||
@ -48,7 +47,6 @@ type (
|
||||
moduleAccessController interface {
|
||||
CanGrant(context.Context) bool
|
||||
|
||||
CanExportModule(context.Context, *types.Module) bool
|
||||
CanUpdateModule(context.Context, *types.Module) bool
|
||||
CanDeleteModule(context.Context, *types.Module) bool
|
||||
CanCreateRecordOnModule(context.Context, *types.Module) bool
|
||||
@ -191,8 +189,6 @@ func (ctrl Module) makePayload(ctx context.Context, m *types.Module, err error)
|
||||
|
||||
CanGrant: ctrl.ac.CanGrant(ctx),
|
||||
|
||||
CanExport: ctrl.ac.CanExportModule(ctx, m),
|
||||
|
||||
CanUpdateModule: ctrl.ac.CanUpdateModule(ctx, m),
|
||||
CanDeleteModule: ctrl.ac.CanDeleteModule(ctx, m),
|
||||
|
||||
|
||||
@ -36,11 +36,10 @@ type (
|
||||
CanDeleteNamespace bool `json:"canDeleteNamespace"`
|
||||
CanManageNamespace bool `json:"canManageNamespace"`
|
||||
CanCreateModule bool `json:"canCreateModule"`
|
||||
CanExportModule bool `json:"canExportModule"`
|
||||
CanExportModules bool `json:"canExportModules"`
|
||||
CanCreateChart bool `json:"canCreateChart"`
|
||||
CanExportChart bool `json:"canExportChart"`
|
||||
CanExportCharts bool `json:"canExportCharts"`
|
||||
CanCreatePage bool `json:"canCreatePage"`
|
||||
CanExportPage bool `json:"canExportPage"`
|
||||
}
|
||||
|
||||
namespaceSetPayload struct {
|
||||
@ -85,7 +84,6 @@ type (
|
||||
CanCreateChartOnNamespace(context.Context, *types.Namespace) bool
|
||||
CanExportChartsOnNamespace(context.Context, *types.Namespace) bool
|
||||
CanCreatePageOnNamespace(context.Context, *types.Namespace) bool
|
||||
CanExportPagesOnNamespace(context.Context, *types.Namespace) bool
|
||||
}
|
||||
)
|
||||
|
||||
@ -365,11 +363,10 @@ func (ctrl Namespace) makePayload(ctx context.Context, ns *types.Namespace, err
|
||||
CanManageNamespace: ctrl.ac.CanManageNamespace(ctx, ns),
|
||||
|
||||
CanCreateModule: ctrl.ac.CanCreateModuleOnNamespace(ctx, ns),
|
||||
CanExportModule: ctrl.ac.CanExportModulesOnNamespace(ctx, ns),
|
||||
CanExportModules: ctrl.ac.CanExportModulesOnNamespace(ctx, ns),
|
||||
CanCreateChart: ctrl.ac.CanCreateChartOnNamespace(ctx, ns),
|
||||
CanExportChart: ctrl.ac.CanExportChartsOnNamespace(ctx, ns),
|
||||
CanExportCharts: ctrl.ac.CanExportChartsOnNamespace(ctx, ns),
|
||||
CanCreatePage: ctrl.ac.CanCreatePageOnNamespace(ctx, ns),
|
||||
CanExportPage: ctrl.ac.CanExportPagesOnNamespace(ctx, ns),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@ type (
|
||||
Children []*pagePayload `json:"children,omitempty"`
|
||||
|
||||
CanGrant bool `json:"canGrant"`
|
||||
CanExportPage bool `json:"canExportPage"`
|
||||
CanUpdatePage bool `json:"canUpdatePage"`
|
||||
CanDeletePage bool `json:"canDeletePage"`
|
||||
}
|
||||
@ -61,7 +60,6 @@ type (
|
||||
CanGrant(context.Context) bool
|
||||
|
||||
CanUpdatePage(context.Context, *types.Page) bool
|
||||
CanExportPage(context.Context, *types.Page) bool
|
||||
CanDeletePage(context.Context, *types.Page) bool
|
||||
}
|
||||
)
|
||||
@ -275,7 +273,6 @@ func (ctrl Page) makePayload(ctx context.Context, c *types.Page, err error) (*pa
|
||||
CanGrant: ctrl.ac.CanGrant(ctx),
|
||||
|
||||
CanUpdatePage: ctrl.ac.CanUpdatePage(ctx, c),
|
||||
CanExportPage: ctrl.ac.CanExportPage(ctx, c),
|
||||
CanDeletePage: ctrl.ac.CanDeletePage(ctx, c),
|
||||
}, nil
|
||||
}
|
||||
|
||||
52
server/compose/service/access_control.gen.go
generated
52
server/compose/service/access_control.gen.go
generated
@ -167,11 +167,6 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ChartRbacResource(0, 0),
|
||||
"op": "delete",
|
||||
},
|
||||
{
|
||||
"type": types.ChartResourceType,
|
||||
"any": types.ChartRbacResource(0, 0),
|
||||
"op": "export",
|
||||
},
|
||||
{
|
||||
"type": types.ModuleResourceType,
|
||||
"any": types.ModuleRbacResource(0, 0),
|
||||
@ -187,11 +182,6 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ModuleRbacResource(0, 0),
|
||||
"op": "delete",
|
||||
},
|
||||
{
|
||||
"type": types.ModuleResourceType,
|
||||
"any": types.ModuleRbacResource(0, 0),
|
||||
"op": "export",
|
||||
},
|
||||
{
|
||||
"type": types.ModuleResourceType,
|
||||
"any": types.ModuleRbacResource(0, 0),
|
||||
@ -282,11 +272,6 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.NamespaceRbacResource(0),
|
||||
"op": "pages.search",
|
||||
},
|
||||
{
|
||||
"type": types.NamespaceResourceType,
|
||||
"any": types.NamespaceRbacResource(0),
|
||||
"op": "pages.export",
|
||||
},
|
||||
{
|
||||
"type": types.PageResourceType,
|
||||
"any": types.PageRbacResource(0, 0),
|
||||
@ -302,11 +287,6 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.PageRbacResource(0, 0),
|
||||
"op": "delete",
|
||||
},
|
||||
{
|
||||
"type": types.PageResourceType,
|
||||
"any": types.PageRbacResource(0, 0),
|
||||
"op": "export",
|
||||
},
|
||||
{
|
||||
"type": types.PageResourceType,
|
||||
"any": types.PageRbacResource(0, 0),
|
||||
@ -505,13 +485,6 @@ func (svc accessControl) CanDeleteChart(ctx context.Context, r *types.Chart) boo
|
||||
return svc.can(ctx, "delete", r)
|
||||
}
|
||||
|
||||
// CanExportChart checks if current user can access to export charts
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanExportChart(ctx context.Context, r *types.Chart) bool {
|
||||
return svc.can(ctx, "export", r)
|
||||
}
|
||||
|
||||
// CanReadModule checks if current user can read
|
||||
//
|
||||
// This function is auto-generated
|
||||
@ -533,13 +506,6 @@ func (svc accessControl) CanDeleteModule(ctx context.Context, r *types.Module) b
|
||||
return svc.can(ctx, "delete", r)
|
||||
}
|
||||
|
||||
// CanExportModule checks if current user can access to export modules
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanExportModule(ctx context.Context, r *types.Module) bool {
|
||||
return svc.can(ctx, "export", r)
|
||||
}
|
||||
|
||||
// CanCreateRecordOnModule checks if current user can create record
|
||||
//
|
||||
// This function is auto-generated
|
||||
@ -666,13 +632,6 @@ func (svc accessControl) CanSearchPagesOnNamespace(ctx context.Context, r *types
|
||||
return svc.can(ctx, "pages.search", r)
|
||||
}
|
||||
|
||||
// CanExportPagesOnNamespace checks if current user can export pages on namespace
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanExportPagesOnNamespace(ctx context.Context, r *types.Namespace) bool {
|
||||
return svc.can(ctx, "pages.export", r)
|
||||
}
|
||||
|
||||
// CanReadPage checks if current user can read
|
||||
//
|
||||
// This function is auto-generated
|
||||
@ -694,13 +653,6 @@ func (svc accessControl) CanDeletePage(ctx context.Context, r *types.Page) bool
|
||||
return svc.can(ctx, "delete", r)
|
||||
}
|
||||
|
||||
// CanExportPage checks if current user can access to export pages
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanExportPage(ctx context.Context, r *types.Page) bool {
|
||||
return svc.can(ctx, "export", r)
|
||||
}
|
||||
|
||||
// CanCreatePageLayoutOnPage checks if current user can create page layout on namespace
|
||||
//
|
||||
// This function is auto-generated
|
||||
@ -932,14 +884,12 @@ func rbacResourceOperations(r string) map[string]bool {
|
||||
"read": true,
|
||||
"update": true,
|
||||
"delete": true,
|
||||
"export": true,
|
||||
}
|
||||
case types.ModuleResourceType:
|
||||
return map[string]bool{
|
||||
"read": true,
|
||||
"update": true,
|
||||
"delete": true,
|
||||
"export": true,
|
||||
"record.create": true,
|
||||
"owned-record.create": true,
|
||||
"records.search": true,
|
||||
@ -964,14 +914,12 @@ func rbacResourceOperations(r string) map[string]bool {
|
||||
"charts.export": true,
|
||||
"page.create": true,
|
||||
"pages.search": true,
|
||||
"pages.export": true,
|
||||
}
|
||||
case types.PageResourceType:
|
||||
return map[string]bool{
|
||||
"read": true,
|
||||
"update": true,
|
||||
"delete": true,
|
||||
"export": true,
|
||||
"page-layout.create": true,
|
||||
"page-layouts.search": true,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user