roleep

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRoleEndpoint

type CreateRoleEndpoint struct{}

Creates a custom role that can then be assigned to users in your account.

Roles created through the API are always owned by your account and have the type `user`. Returns a conflict error if a role with the same name already exists.

func (*CreateRoleEndpoint) Materialize

type CreateRoleRequest

type CreateRoleRequest struct {
	// Display name for the role, such as "Warehouse Manager".
	//
	// Must be unique within your account.
	Name string `json:"name" validate:"required,max=255"`
	// Permissions to grant, in `{permission}:{action}` format, such as `customers:read`.
	//
	// The first half is a permission code such as `customers` or `sales_orders`, and the action must be one of `create`, `read`, `update`, or `delete`. List each action separately to grant more than one action on the same permission. A role created without any permissions grants no access until permissions are added.
	Permissions []string `json:"permissions,omitzero"`
}

Request to create a role.

func (*CreateRoleRequest) SchemaExample

func (*CreateRoleRequest) SchemaExample() any

type DeleteRoleEndpoint

type DeleteRoleEndpoint struct{}

Deletes a role along with the permissions granted through it.

Only roles owned by your account can be deleted; the system-owned roles shared across all accounts cannot. A role that is still assigned to at least one user is rejected, so move those users to another role first.

func (*DeleteRoleEndpoint) Materialize

type DeleteRoleRequest

type DeleteRoleRequest struct {
	// Role ID.
	RoleID string `path:"id" validate:"required"`
}

Request to delete a role.

type ListRolesEndpoint

type ListRolesEndpoint struct{}

Lists the roles that can be assigned to users in your account, newest first.

Results combine the roles your account owns with the system-owned roles shared by every account. Text search matches the role name.

func (*ListRolesEndpoint) Materialize

type ListRolesRequest

type ListRolesRequest struct {
	apiresource.PaginationRequest
	// Filter results to roles whose type matches any of the given values.
	RoleType []constants.RoleType `query:"types"`
}

Request to list roles.

type RetrieveRoleEndpoint

type RetrieveRoleEndpoint struct{}

Retrieves a single role by ID.

Both the roles your account owns and the system-owned roles shared by every account can be retrieved.

func (*RetrieveRoleEndpoint) Materialize

type RetrieveRoleRequest

type RetrieveRoleRequest struct {
	// Role ID.
	RoleID string `path:"id" validate:"required"`
}

Request to retrieve a role.

type RoleSvcConfig

type RoleSvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type UpdateRoleEndpoint

type UpdateRoleEndpoint struct{}

Updates a role's name or the set of permissions it grants.

Only roles owned by your account can be updated; the system-owned roles shared across all accounts are rejected. Permission changes apply to every user already assigned the role, starting with their next request.

func (*UpdateRoleEndpoint) Materialize

type UpdateRoleRequest

type UpdateRoleRequest struct {
	// Role ID.
	RoleID string `path:"id" validate:"required"`
	// New display name for the role.
	//
	// Returns a conflict error if another role in your account already uses this name.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Full replacement set of permissions, in `{permission}:{action}` format, such as `customers:read`.
	//
	// The role's existing permissions are discarded and replaced with exactly what you send, so include every permission the role should keep. Sending an empty array strips the role of all access, while leaving the field out keeps the current permissions untouched.
	Permissions field.Optional[[]string] `json:"permissions,omitzero"`
}

Request to update a role.

func (*UpdateRoleRequest) SchemaExample

func (*UpdateRoleRequest) SchemaExample() any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL