Define *.search operations for all resources
This commit is contained in:
Generated
+92
-1
@@ -182,6 +182,11 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "grant",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "action-log.read",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
@@ -197,21 +202,41 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "auth-client.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "auth-clients.search",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "role.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "roles.search",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "user.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "users.search",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "application.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "applications.search",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
@@ -227,6 +252,11 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "template.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "templates.search",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
@@ -237,6 +267,11 @@ func (svc accessControl) List() (out []map[string]string) {
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "queue.create",
|
||||
},
|
||||
{
|
||||
"type": types.ComponentResourceType,
|
||||
"any": types.ComponentRbacResource(),
|
||||
"op": "queues.search",
|
||||
},
|
||||
}
|
||||
|
||||
func(svc interface{}) {
|
||||
@@ -467,6 +502,13 @@ func (svc accessControl) CanGrant(ctx context.Context) bool {
|
||||
return svc.can(ctx, "grant", &types.Component{})
|
||||
}
|
||||
|
||||
// CanReadActionLog checks if current user can access to action log
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanReadActionLog(ctx context.Context) bool {
|
||||
return svc.can(ctx, "action-log.read", &types.Component{})
|
||||
}
|
||||
|
||||
// CanReadSettings checks if current user can read system settings
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -488,6 +530,13 @@ func (svc accessControl) CanCreateAuthClient(ctx context.Context) bool {
|
||||
return svc.can(ctx, "auth-client.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchAuthClients checks if current user can list, search or filter auth clients
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchAuthClients(ctx context.Context) bool {
|
||||
return svc.can(ctx, "auth-clients.search", &types.Component{})
|
||||
}
|
||||
|
||||
// CanCreateRole checks if current user can create roles
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -495,6 +544,13 @@ func (svc accessControl) CanCreateRole(ctx context.Context) bool {
|
||||
return svc.can(ctx, "role.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchRoles checks if current user can list, search or filter roles
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchRoles(ctx context.Context) bool {
|
||||
return svc.can(ctx, "roles.search", &types.Component{})
|
||||
}
|
||||
|
||||
// CanCreateUser checks if current user can create users
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -502,6 +558,13 @@ func (svc accessControl) CanCreateUser(ctx context.Context) bool {
|
||||
return svc.can(ctx, "user.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchUsers checks if current user can list, search or filter users
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchUsers(ctx context.Context) bool {
|
||||
return svc.can(ctx, "users.search", &types.Component{})
|
||||
}
|
||||
|
||||
// CanCreateApplication checks if current user can create applications
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -509,6 +572,13 @@ func (svc accessControl) CanCreateApplication(ctx context.Context) bool {
|
||||
return svc.can(ctx, "application.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchApplications checks if current user can list, search or filter auth clients
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchApplications(ctx context.Context) bool {
|
||||
return svc.can(ctx, "applications.search", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSelfApplicationFlag checks if current user can manage private flags for applications
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -530,6 +600,13 @@ func (svc accessControl) CanCreateTemplate(ctx context.Context) bool {
|
||||
return svc.can(ctx, "template.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchTemplates checks if current user can list, search or filter templates
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchTemplates(ctx context.Context) bool {
|
||||
return svc.can(ctx, "templates.search", &types.Component{})
|
||||
}
|
||||
|
||||
// CanAssignReminder checks if current user can assign reminders
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -537,13 +614,20 @@ func (svc accessControl) CanAssignReminder(ctx context.Context) bool {
|
||||
return svc.can(ctx, "reminder.assign", &types.Component{})
|
||||
}
|
||||
|
||||
// CanCreateQueue checks if current user can create messagebus queues
|
||||
// CanCreateQueue checks if current user can create message queue
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanCreateQueue(ctx context.Context) bool {
|
||||
return svc.can(ctx, "queue.create", &types.Component{})
|
||||
}
|
||||
|
||||
// CanSearchQueues checks if current user can list, search or filter message queues
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (svc accessControl) CanSearchQueues(ctx context.Context) bool {
|
||||
return svc.can(ctx, "queues.search", &types.Component{})
|
||||
}
|
||||
|
||||
// rbacResourceValidator validates known component's resource by routing it to the appropriate validator
|
||||
//
|
||||
// This function is auto-generated
|
||||
@@ -612,17 +696,24 @@ func rbacResourceOperations(r string) map[string]bool {
|
||||
case types.ComponentResourceType:
|
||||
return map[string]bool{
|
||||
"grant": true,
|
||||
"action-log.read": true,
|
||||
"settings.read": true,
|
||||
"settings.manage": true,
|
||||
"auth-client.create": true,
|
||||
"auth-clients.search": true,
|
||||
"role.create": true,
|
||||
"roles.search": true,
|
||||
"user.create": true,
|
||||
"users.search": true,
|
||||
"application.create": true,
|
||||
"applications.search": true,
|
||||
"application.flag.self": true,
|
||||
"application.flag.global": true,
|
||||
"template.create": true,
|
||||
"templates.search": true,
|
||||
"reminder.assign": true,
|
||||
"queue.create": true,
|
||||
"queues.search": true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -553,12 +553,12 @@ func ApplicationErrNotAllowedToRead(mm ...*applicationActionProps) *errors.Error
|
||||
return e
|
||||
}
|
||||
|
||||
// ApplicationErrNotAllowedToListApplications returns "system:application.notAllowedToListApplications" as *errors.Error
|
||||
// ApplicationErrNotAllowedToSearch returns "system:application.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func ApplicationErrNotAllowedToListApplications(mm ...*applicationActionProps) *errors.Error {
|
||||
func ApplicationErrNotAllowedToSearch(mm ...*applicationActionProps) *errors.Error {
|
||||
var p = &applicationActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
@@ -567,13 +567,13 @@ func ApplicationErrNotAllowedToListApplications(mm ...*applicationActionProps) *
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to list applications", nil),
|
||||
p.Format("not allowed to search or list applications", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToListApplications"),
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:application"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(applicationLogMetaKey{}, "failed to list application; insufficient permissions"),
|
||||
errors.Meta(applicationLogMetaKey{}, "failed to search or list applications; insufficient permissions"),
|
||||
errors.Meta(applicationPropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
|
||||
@@ -69,9 +69,9 @@ errors:
|
||||
message: "not allowed to read this application"
|
||||
log: "failed to read {application.name}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToListApplications
|
||||
message: "not allowed to list applications"
|
||||
log: "failed to list application; insufficient permissions"
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to search or list applications"
|
||||
log: "failed to search or list applications; insufficient permissions"
|
||||
|
||||
- error: notAllowedToCreate
|
||||
message: "not allowed to create applications"
|
||||
|
||||
+5
-5
@@ -530,12 +530,12 @@ func AuthClientErrNotAllowedToRead(mm ...*authClientActionProps) *errors.Error {
|
||||
return e
|
||||
}
|
||||
|
||||
// AuthClientErrNotAllowedToListAuthClients returns "system:auth-client.notAllowedToListAuthClients" as *errors.Error
|
||||
// AuthClientErrNotAllowedToSearch returns "system:auth-client.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func AuthClientErrNotAllowedToListAuthClients(mm ...*authClientActionProps) *errors.Error {
|
||||
func AuthClientErrNotAllowedToSearch(mm ...*authClientActionProps) *errors.Error {
|
||||
var p = &authClientActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
@@ -544,13 +544,13 @@ func AuthClientErrNotAllowedToListAuthClients(mm ...*authClientActionProps) *err
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to list auth clients", nil),
|
||||
p.Format("not allowed to search or list auth clients", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToListAuthClients"),
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:auth-client"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(authClientLogMetaKey{}, "failed to list authClient; insufficient permissions"),
|
||||
errors.Meta(authClientLogMetaKey{}, "failed to search or list authClient; insufficient permissions"),
|
||||
errors.Meta(authClientPropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
|
||||
@@ -65,9 +65,9 @@ errors:
|
||||
message: "not allowed to read this auth client"
|
||||
log: "failed to read {authClient}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToListAuthClients
|
||||
message: "not allowed to list auth clients"
|
||||
log: "failed to list authClient; insufficient permissions"
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to search or list auth clients"
|
||||
log: "failed to search or list authClient; insufficient permissions"
|
||||
|
||||
- error: notAllowedToCreate
|
||||
message: "not allowed to create auth clients"
|
||||
|
||||
Generated
+32
@@ -578,6 +578,38 @@ func QueueErrNotAllowedToRead(mm ...*queueActionProps) *errors.Error {
|
||||
return e
|
||||
}
|
||||
|
||||
// QueueErrNotAllowedToSearch returns "system:queue.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func QueueErrNotAllowedToSearch(mm ...*queueActionProps) *errors.Error {
|
||||
var p = &queueActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
}
|
||||
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to search or list queues", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:queue"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(queueLogMetaKey{}, "failed to search or list; insufficient permissions"),
|
||||
errors.Meta(queuePropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
)
|
||||
|
||||
if len(mm) > 0 {
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
// QueueErrNotAllowedToUpdate returns "system:queue.notAllowedToUpdate" as *errors.Error
|
||||
//
|
||||
//
|
||||
|
||||
@@ -72,6 +72,10 @@ errors:
|
||||
message: "not allowed to read this queue"
|
||||
log: "failed to read {queue.queue}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to search or list queues"
|
||||
log: "failed to search or list; insufficient permissions"
|
||||
|
||||
- error: notAllowedToUpdate
|
||||
message: "not allowed to update this queue"
|
||||
log: "failed to update {queue.queue}; insufficient permissions"
|
||||
|
||||
Generated
+5
-5
@@ -766,12 +766,12 @@ func RoleErrNotAllowedToRead(mm ...*roleActionProps) *errors.Error {
|
||||
return e
|
||||
}
|
||||
|
||||
// RoleErrNotAllowedToListRoles returns "system:role.notAllowedToListRoles" as *errors.Error
|
||||
// RoleErrNotAllowedToSearch returns "system:role.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func RoleErrNotAllowedToListRoles(mm ...*roleActionProps) *errors.Error {
|
||||
func RoleErrNotAllowedToSearch(mm ...*roleActionProps) *errors.Error {
|
||||
var p = &roleActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
@@ -780,13 +780,13 @@ func RoleErrNotAllowedToListRoles(mm ...*roleActionProps) *errors.Error {
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to list roles", nil),
|
||||
p.Format("not allowed to search or list roles", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToListRoles"),
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:role"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(roleLogMetaKey{}, "failed to list role; insufficient permissions"),
|
||||
errors.Meta(roleLogMetaKey{}, "failed to search or list roles; insufficient permissions"),
|
||||
errors.Meta(rolePropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
|
||||
@@ -92,9 +92,9 @@ errors:
|
||||
message: "not allowed to read this role"
|
||||
log: "failed to read {role.handle}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToListRoles
|
||||
message: "not allowed to list roles"
|
||||
log: "failed to list role; insufficient permissions"
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to search or list roles"
|
||||
log: "failed to search or list roles; insufficient permissions"
|
||||
|
||||
- error: notAllowedToCreate
|
||||
message: "not allowed to create roles"
|
||||
|
||||
Generated
+5
-5
@@ -588,12 +588,12 @@ func TemplateErrNotAllowedToRead(mm ...*templateActionProps) *errors.Error {
|
||||
return e
|
||||
}
|
||||
|
||||
// TemplateErrNotAllowedToListTemplates returns "system:template.notAllowedToListTemplates" as *errors.Error
|
||||
// TemplateErrNotAllowedToSearch returns "system:template.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func TemplateErrNotAllowedToListTemplates(mm ...*templateActionProps) *errors.Error {
|
||||
func TemplateErrNotAllowedToSearch(mm ...*templateActionProps) *errors.Error {
|
||||
var p = &templateActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
@@ -602,13 +602,13 @@ func TemplateErrNotAllowedToListTemplates(mm ...*templateActionProps) *errors.Er
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to list templates", nil),
|
||||
p.Format("not allowed to search or list templates", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToListTemplates"),
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:template"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(templateLogMetaKey{}, "failed to list template; insufficient permissions"),
|
||||
errors.Meta(templateLogMetaKey{}, "failed to search or list templates; insufficient permissions"),
|
||||
errors.Meta(templatePropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
|
||||
@@ -70,9 +70,9 @@ errors:
|
||||
message: "not allowed to read this template"
|
||||
log: "failed to read {template.handle}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToListTemplates
|
||||
message: "not allowed to list templates"
|
||||
log: "failed to list template; insufficient permissions"
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to search or list templates"
|
||||
log: "failed to search or list templates; insufficient permissions"
|
||||
|
||||
- error: notAllowedToCreate
|
||||
message: "not allowed to create templates"
|
||||
|
||||
Generated
+32
@@ -734,6 +734,38 @@ func UserErrNotAllowedToRead(mm ...*userActionProps) *errors.Error {
|
||||
return e
|
||||
}
|
||||
|
||||
// UserErrNotAllowedToSearch returns "system:user.notAllowedToSearch" as *errors.Error
|
||||
//
|
||||
//
|
||||
// This function is auto-generated.
|
||||
//
|
||||
func UserErrNotAllowedToSearch(mm ...*userActionProps) *errors.Error {
|
||||
var p = &userActionProps{}
|
||||
if len(mm) > 0 {
|
||||
p = mm[0]
|
||||
}
|
||||
|
||||
var e = errors.New(
|
||||
errors.KindInternal,
|
||||
|
||||
p.Format("not allowed to list or search users", nil),
|
||||
|
||||
errors.Meta("type", "notAllowedToSearch"),
|
||||
errors.Meta("resource", "system:user"),
|
||||
|
||||
// action log entry; no formatting, it will be applied inside recordAction fn.
|
||||
errors.Meta(userLogMetaKey{}, "failed to search for users; insufficient permissions"),
|
||||
errors.Meta(userPropsMetaKey{}, p),
|
||||
|
||||
errors.StackSkip(1),
|
||||
)
|
||||
|
||||
if len(mm) > 0 {
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
// UserErrNotAllowedToListUsers returns "system:user.notAllowedToListUsers" as *errors.Error
|
||||
//
|
||||
//
|
||||
|
||||
@@ -86,6 +86,10 @@ errors:
|
||||
message: "not allowed to read this user"
|
||||
log: "failed to read {user.handle}; insufficient permissions"
|
||||
|
||||
- error: notAllowedToSearch
|
||||
message: "not allowed to list or search users"
|
||||
log: "failed to search for users; insufficient permissions"
|
||||
|
||||
- error: notAllowedToListUsers
|
||||
message: "not allowed to list users"
|
||||
log: "failed to list user; insufficient permissions"
|
||||
|
||||
Reference in New Issue
Block a user