rbac

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionSettingsView = "settings:view"
	ActionSettingsEdit = "settings:edit"
)

Settings actions

View Source
const (
	ActionUserView = "user:view"
	ActionUserEdit = "user:edit"
)

Users actions

View Source
const (
	ActionGroupView = "group:view"
	ActionGroupEdit = "group:edit"
)

Groups actions

View Source
const (
	ActionRoleView   = "role:view"
	ActionRoleEdit   = "role:edit"
	ActionRoleAssign = "role:assign"
	ActionRoleRevoke = "role:retract"
)

Roles actions

View Source
const (
	ActionServiceAccountView = "serviceaccount:view"
	ActionServiceAccountEdit = "serviceaccount:edit"
)

Service accounts actions

View Source
const (
	ActionProjectView = "project:view"
	ActionProjectEdit = "project:edit"
)

Projects actions

View Source
const (
	// Get, List, GetRollout, ListRollout, ListEvents, Logs, ListImages,
	// ListInstances, ListInstanceStatuses, GetInstanceSatatus, CapsuleMetrics
	ActionCapsuleView = "capsule:view"
	// Update Capsules
	ActionCapsuleEdit = "capsule:edit"
	// Create
	ActionCapsuleCreate = "capsule:create"
	// Delete
	ActionCapsuleDelete = "capsule:delete"
	// Execute
	ActionCapsuleExecute = "capsule:execute"
	// Restart instance
	ActionCapsuleRestartInstance = "capsule:restartinstance"
	// Abort rollout
	ActionCapsuleAbortRollout = "capsule:abortrollout"
	// Stop rollout
	ActionCapsuleStopRollout = "capsule:stoprollout"

	// Deploy
	ActionCapsuleDeploy = "capsule:deploy"
	// Horizontally scaling - replicas
	ActionCapsuleDeployReplica = "capsule:deploy:replica"
	// Autoscaling - min, max and cpu threshold - Horizontal scaling
	ActionCapsuleDeployAutoscale = "capsule:deploy:autoscale"
	// Container Settings - Vertical scaling, Environment variables, Command and Args
	ActionCapsuleDeployContainer = "capsule:deploy:container"
	// Config Files - Add and remove config files
	ActionCapsuleDeployConfigFiles = "capsule:deploy:configfiles"
	// Network - Add, remove and update networks
	ActionCapsuleDeployNetwork = "capsule:deploy:network"
	// Rollback
	ActionCapsuleDeployRollback = "capsule:deploy:rollback"
	// Deploy a new image
	ActionCapsuleDeployImage = "capsule:deploy:image"
	// Auto add service account to the capsule
	ActionCapsuleDeployServiceAccount = "capsule:deploy:serviceaccount"
	// Chron jobs
	ActionCapsuleDeployChron = "capsule:deploy:chron"
	// Environment variables - set or remove environment variables
	ActionCapsuleDeployEnvironmentVariables = "capsule:deploy:environmentvariables"
	// Environment sources - set or remove environment sources
	ActionCapsuleDeployEnvironmentSources = "capsule:deploy:environmentsources"
	// Container Settings - Vertical scaling, Environment variables, Command and Args
	ActionCapsuleDeployAnnotations = "capsule:deploy:annotations"
)

Capsules actions

View Source
const (
	// Create images
	ActionImageAdd = "image:add"
	// Delete images
	ActionImageDelete = "image:delete"
	// View all parts of the build - GetImage, GetImageImageInfo, GetRepositoryInfo, GetImageLogs, GetImageStatus
	ActionImageView = "image:view"
)
View Source
const (
	ActionEnvironmentEdit = "environment:edit"
	// Create and delete ephemeral environments
	ActionEnvironmentEditEphemeral = "environment:edit:ephemeral"
	ActionEnvironmentView          = "environment:view"
)
View Source
const (
	ResourceCapsule        = "capsule"
	ResourceImage          = "image"
	ResourceUser           = "user"
	ResourceGroup          = "group"
	ResourceProject        = "project"
	ResourceRole           = "role"
	ResourceServiceAccount = "serviceaccount"
	ResourceSettings       = "settings"
	ResourceCluster        = "cluster"
	ResourceEnvironment    = "environment"
)
View Source
const (
	ActionClusterConfigView = "clusterconfig:view"
)

Cluster config actions

Variables

Functions

func GetAdminPermissions

func GetAdminPermissions(projectID, environmentID string) []*role.Permission

Admins can do everything - Thing that are not only in the others are: - Project Edit. This means Create, Delete and Update projects - Settings Edit. This means Update project and user settings - Environment Edit. This means Create, Delete and Update environments - Role Edit. This means Create, Delete and Update roles - Role Assign. Assign roles to users, groups and service accounts - Role Revoke. Revoke roles from users, groups and service accounts - User Edit. This means Create, Delete and Update users - Group Edit. This means Create, Delete and Update groups, aswell as add users to groups - Service Account Edit. This means Create, Delete and Update service accounts

func GetDeveloperPermissions

func GetDeveloperPermissions(projectID, environmentID string) []*role.Permission

Developers can do everything a viewer can do, in addition to:

  • editing ephemeral environments
  • work with capsules and images in all aspects except creating and deleting them

func GetOwnerPermissions

func GetOwnerPermissions(projectID, environmentID string) []*role.Permission

Owners can do everything a developer can do, plus: - Capsule Create, Delete and Edit. - Image Delete. This means Delete images - Capsule Stop Rollout. This means Stop rollouts

func GetViewerPermissions

func GetViewerPermissions(projectID, environmentID string) []*role.Permission

Viewers can view all resources

func WithEmpty

func WithEmpty(resource string) string

func WithID

func WithID(resource, id string) string

func WithWildcard

func WithWildcard(resource string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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