accesstypes

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

package accesstypes provides types for permissions, roles, and domains types for the access package

Index

Constants

View Source
const GlobalDomain = Domain("global")

GlobalDomain is the domain used when a permission is applied at the Global level instead of to a specific domain.

View Source
const GlobalResource = Resource("*")

GlobalResource is the resource used when a permission is applied to the entire application, (i.e. Global level) instead of to a specific resource.

View Source
const NoopUser = "noop"

NoopUser is the user assigned to an empty role in casbin to ensure the role can be enumerated if no one else is assigned

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain string

func UnmarshalDomain

func UnmarshalDomain(domain string) Domain

func (Domain) IsValid

func (d Domain) IsValid() bool

func (Domain) Marshal

func (d Domain) Marshal() string

type Permission

type Permission string

func UnmarshalPermission

func UnmarshalPermission(permission string) Permission

func (Permission) IsValid

func (p Permission) IsValid() bool

func (Permission) Marshal

func (p Permission) Marshal() string

type PermissionDetail

type PermissionDetail struct {
	Description string
	Scope       PermissionScope
}

type PermissionScope

type PermissionScope string
const (
	GlobalPermissionScope PermissionScope = "global"
	DomainPermissionScope PermissionScope = "domain"
)

type Resource added in v0.1.4

type Resource string

func UnmarshalResource added in v0.1.4

func UnmarshalResource(resource string) Resource

func (Resource) IsValid added in v0.1.4

func (d Resource) IsValid() bool

func (Resource) Marshal added in v0.1.4

func (d Resource) Marshal() string

type Role

type Role string

func UnmarshalRole

func UnmarshalRole(role string) Role

func (Role) IsValid

func (r Role) IsValid() bool

func (Role) Marshal

func (r Role) Marshal() string

type RoleCollection added in v0.1.4

type RoleCollection map[Domain][]Role

type RolePermissionCollection added in v0.1.4

type RolePermissionCollection map[Permission][]Resource

func (RolePermissionCollection) Permissions added in v0.1.4

func (r RolePermissionCollection) Permissions() []Permission

type User

type User string

User represents a user in the authorization system

func UnmarshalUser

func UnmarshalUser(user string) User

func (User) IsValid

func (u User) IsValid() bool

func (User) Marshal

func (u User) Marshal() string

type UserPermissionCollection added in v0.1.4

type UserPermissionCollection map[Domain]map[Permission][]Resource

func (UserPermissionCollection) DomainPermissions added in v0.1.4

func (p UserPermissionCollection) DomainPermissions(domains ...Domain) map[Domain][]Permission

func (UserPermissionCollection) Domains added in v0.1.4

func (p UserPermissionCollection) Domains() []Domain

func (UserPermissionCollection) GlobalPermissions added in v0.1.4

func (p UserPermissionCollection) GlobalPermissions() map[Domain][]Permission

Jump to

Keyboard shortcuts

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