types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types exposes domain types for permissions-api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.1.4

type Action struct {
	Name       string
	Conditions []Condition
}

Action represents a named thing a subject can do.

type Condition added in v0.1.4

type Condition struct {
	RoleBinding        *ConditionRoleBinding
	RelationshipAction *ConditionRelationshipAction
}

Condition represents a required condition for performing an action.

type ConditionRelationshipAction added in v0.1.4

type ConditionRelationshipAction struct {
	Relation   string
	ActionName string
}

ConditionRelationshipAction represents a condition where an action must be able to be performed on another resource along a relation to perform an action.

type ConditionRoleBinding added in v0.1.4

type ConditionRoleBinding struct{}

ConditionRoleBinding represents a condition where a role binding is necessary to perform an action.

type Relationship

type Relationship struct {
	Resource Resource
	Relation string
	Subject  Resource
}

Relationship represents a named association between a resource and a subject.

type Resource

type Resource struct {
	Type string
	ID   gidx.PrefixedID
}

Resource is the object to be acted upon by an subject

type ResourceType

type ResourceType struct {
	Name          string
	IDPrefix      string
	Relationships []ResourceTypeRelationship
	Actions       []Action
}

ResourceType defines a type of resource managed by the api

type ResourceTypeRelationship

type ResourceTypeRelationship struct {
	Relation string
	Types    []string
}

ResourceTypeRelationship is a relationship for a resource type.

type Role

type Role struct {
	ID      gidx.PrefixedID
	Name    string
	Actions []string

	ResourceID gidx.PrefixedID
	CreatedBy  gidx.PrefixedID
	UpdatedBy  gidx.PrefixedID
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Role is a collection of permissions.

Jump to

Keyboard shortcuts

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