permission

package
v0.0.0-...-11c8b56 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: AGPL-3.0 Imports: 0 Imported by: 8

Documentation

Overview

Package permission is used to store the various permission in praelatus, it acts as a pseudo-enumeration

Index

Constants

View Source
const (
	ViewProject      Permission = "VIEW_PROJECT"
	AdminProject                = "ADMIN_PROJECT"
	CreateTicket                = "CREATE_TICKET"
	CommentTicket               = "COMMENT_TICKET"
	RemoveComment               = "REMOVE_COMMENT"
	RemoveOwnComment            = "REMOVE_OWN_COMMENT"
	EditOwnComment              = "EDIT_OWN_COMMENT"
	EditComment                 = "EDIT_COMMENT"
	TransitionTicket            = "TRANSITION_TICKET"
	EditTicket                  = "EDIT_TICKET"
	RemoveTicket                = "REMOVE_TICKET"
)

These are the permissions available in Praelatus

Variables

ListOfPermissions holds available permissions in a slice. This is valuable for various areas where we need to return all permissions or iterate permissions.

Functions

func ValidPermission

func ValidPermission(permName Permission) bool

ValidPermission will verify that a given permission string is valid.

Types

type Permission

type Permission string

Permission is an alias type to make it's use more clear inside of models.

type Permissions

type Permissions []string

Permissions is used to add some convenience functions for checking permisisons

func (Permissions) Add

func (p Permissions) Add(perms ...Permission) Permissions

func (Permissions) Contains

func (p Permissions) Contains(permName Permission) bool

Jump to

Keyboard shortcuts

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