juju: github.com/juju/juju/permission Index | Files

package permission

import "github.com/juju/juju/permission"

Index

Package Files

access.go useraccess.go

func IsEmptyUserAccess Uses

func IsEmptyUserAccess(a UserAccess) bool

IsEmptyUserAccess returns true if the passed UserAccess instance is empty.

func ValidateCloudAccess Uses

func ValidateCloudAccess(access Access) error

ValidateCloudAccess returns error if the passed access is not a valid cloud access level.

func ValidateControllerAccess Uses

func ValidateControllerAccess(access Access) error

ValidateControllerAccess returns error if the passed access is not a valid controller access level.

func ValidateModelAccess Uses

func ValidateModelAccess(access Access) error

ValidateModelAccess returns error if the passed access is not a valid model access level.

func ValidateOfferAccess Uses

func ValidateOfferAccess(access Access) error

ValidateOfferAccess returns error if the passed access is not a valid offer access level.

type Access Uses

type Access string

Access represents a level of access.

const (
    // NoAccess allows a user no permissions at all.
    NoAccess Access = ""

    // ReadAccess allows a user to read information about a permission subject,
    // without being able to make any changes.
    ReadAccess Access = "read"

    // WriteAccess allows a user to make changes to a permission subject.
    WriteAccess Access = "write"

    // ConsumeAccess allows a user to consume a permission subject.
    ConsumeAccess Access = "consume"

    // AdminAccess allows a user full control over the subject.
    AdminAccess Access = "admin"

    // LoginAccess allows a user to log-ing into the subject.
    LoginAccess Access = "login"

    // AddModelAccess allows user to add new models in subjects supporting it.
    AddModelAccess Access = "add-model"

    // SuperuserAccess allows user unrestricted permissions in the subject.
    SuperuserAccess Access = "superuser"
)

func (Access) EqualOrGreaterCloudAccessThan Uses

func (a Access) EqualOrGreaterCloudAccessThan(access Access) bool

EqualOrGreaterCloudAccessThan returns true if the current access is equal or greater than the passed in access level.

func (Access) EqualOrGreaterControllerAccessThan Uses

func (a Access) EqualOrGreaterControllerAccessThan(access Access) bool

EqualOrGreaterControllerAccessThan returns true if the current access is equal or greater than the passed in access level.

func (Access) EqualOrGreaterModelAccessThan Uses

func (a Access) EqualOrGreaterModelAccessThan(access Access) bool

EqualOrGreaterModelAccessThan returns true if the current access is equal or greater than the passed in access level.

func (Access) EqualOrGreaterOfferAccessThan Uses

func (a Access) EqualOrGreaterOfferAccessThan(access Access) bool

EqualOrGreaterOfferAccessThan returns true if the current access is equal or greater than the passed in access level.

func (Access) GreaterControllerAccessThan Uses

func (a Access) GreaterControllerAccessThan(access Access) bool

GreaterControllerAccessThan returns true if the current access is greater than the passed in access level.

func (Access) GreaterModelAccessThan Uses

func (a Access) GreaterModelAccessThan(access Access) bool

GreaterModelAccessThan returns true if the current access is greater than the passed in access level.

func (Access) GreaterOfferAccessThan Uses

func (a Access) GreaterOfferAccessThan(access Access) bool

GreaterOfferAccessThan returns true if the current access is greater than the passed in access level.

func (Access) Validate Uses

func (a Access) Validate() error

Validate returns error if the current is not a valid access level.

type UserAccess Uses

type UserAccess struct {
    // UserID is the stored ID of the user.
    UserID string
    // UserTag is the tag for the user.
    UserTag names.UserTag
    // Object is the tag for the object of this access grant.
    Object names.Tag
    // Access represents the level of access subject has over object.
    Access Access
    // CreatedBy is the tag of the user that granted the access.
    CreatedBy names.UserTag
    // DateCreated is the date the user was created in UTC.
    DateCreated time.Time
    // DisplayName is the name we are showing for this user.
    DisplayName string
    // UserName is the actual username for this access.
    UserName string
}

UserAccess represents a user access to a target whereas the user could represent a remote user or a user across multiple models the user access always represents a single user for a single target. There should be no more than one UserAccess per target/user pair. Many of these fields are storage artifacts but generate them from other fields implies out of band knowledge of other packages.

Package permission imports 3 packages (graph) and is imported by 472 packages. Updated 2019-08-25. Refresh now. Tools for package owners.