permissions

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Organizations management
	EditOrganizations   = "organizations:edit"
	DeleteOrganizations = "organizations:delete"
	ReadOrganizations   = "organizations:read"

	// Organization collaborators management
	AddCollaborators    = "collaborators:add"
	RemoveCollaborators = "collaborators:remove"
	EditCollaborators   = "collaborators:edit"
	ReadCollaborators   = "collaborators:read"

	// Organization projects management
	EditProjects   = "projects:edit"
	DeleteProjects = "projects:delete"
	ReadProjects   = "projects:read"

	// Project API Keys management
	EditAPIKeys   = "apikeys:edit"
	DeleteAPIKeys = "apikeys:delete"
	ReadAPIKeys   = "apikeys:read"

	// Project topics management
	CreateTopics  = "topics:create"
	EditTopics    = "topics:edit"
	DestroyTopics = "topics:destroy"
	ReadTopics    = "topics:read"

	// Eventing permissions
	ReadMetrics = "metrics:read"
	Publisher   = "publisher"
	Subscriber  = "subscriber"
)

These permissions are used to authorize user requests and should match the defined permissions in the quarterdeck database.

NOTE: if adding or removing permissions from this list, they also need to be updated in a database migration. Please also ensure that the AllPermissions variable is also updated to ensure that the tests pass.

View Source
const (
	RoleOwner    = "Owner"
	RoleAdmin    = "Admin"
	RoleMember   = "Member"
	RoleObserver = "Observer"
)

Roles define collections of permissions; these constants are the roles defined in the Quarterdeck datbase and should be kept up to date with the database schema.

Variables

AllPermissions contains the list of all available permissions and is primarily used for testing or determining if a string is a valid permission without doing a database query. It maps the permission string to the primary key of the permission, helping with database migration generation.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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