rbac

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialAdmin = "admin"
	CredentialUse   = "use"
)
View Source
const (
	RoleTypeTeam = "team"
	RoleTypeUser = "user"
)

Important: if you are adding roles to team which means you are adding user to that team

View Source
const (
	InventoryAdmin  = "admin"
	InventoryUse    = "use"
	InventoryUpdate = "update"
)
View Source
const (
	JobTemplateAdmin   = "admin"
	JobTemplateExecute = "execute"
)
View Source
const (
	OrganizationAdmin   = "admin"
	OrganizationAuditor = "auditor"
	OrganizationMember  = "member"
)
View Source
const (
	ProjectAdmin  = "admin"
	ProjectUse    = "use"
	ProjectUpdate = "update"
)
View Source
const (
	TeamAdmin  = "admin"
	TeamMember = "member"
)

Variables

This section is empty.

Functions

func HasGlobalRead

func HasGlobalRead(user common.User) bool

func HasGlobalWrite

func HasGlobalWrite(user common.User) bool

func HasOrganizationRead

func HasOrganizationRead(orgID bson.ObjectId, userID bson.ObjectId) bool

func IsInTeams

func IsInTeams(userID bson.ObjectId, teams []bson.ObjectId) bool

func IsOrganizationAdmin

func IsOrganizationAdmin(orgID bson.ObjectId, userID bson.ObjectId) bool

Types

type Credential

type Credential struct{}

func (Credential) Associate

func (Credential) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Credential) Disassociate

func (Credential) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Credential) Read

func (Credential) Read(user common.User, credential common.Credential) bool

func (Credential) ReadByID

func (c Credential) ReadByID(user common.User, credentialID bson.ObjectId) bool

func (Credential) Write

func (Credential) Write(user common.User, credential common.Credential) bool

type Inventory

type Inventory struct{}

func (Inventory) Associate

func (Inventory) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Inventory) Disassociate

func (Inventory) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Inventory) Read

func (Inventory) Read(user common.User, inventory ansible.Inventory) bool

func (Inventory) ReadByID

func (i Inventory) ReadByID(user common.User, inventoryID bson.ObjectId) bool

func (Inventory) Write

func (Inventory) Write(user common.User, inventory ansible.Inventory) bool

func (Inventory) WriteByID

func (i Inventory) WriteByID(user common.User, inventoryID bson.ObjectId) bool

type JobTemplate

type JobTemplate struct{}

func (JobTemplate) Associate

func (JobTemplate) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (JobTemplate) Disassociate

func (JobTemplate) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (JobTemplate) Read

func (JobTemplate) Read(user common.User, jtemplate ansible.JobTemplate) bool

func (JobTemplate) ReadByID

func (j JobTemplate) ReadByID(user common.User, templateID bson.ObjectId) bool

func (JobTemplate) Write

func (JobTemplate) Write(user common.User, jtemplate ansible.JobTemplate) bool

func (JobTemplate) WriteByID

func (j JobTemplate) WriteByID(user common.User, templateID bson.ObjectId) bool

type Organization

type Organization struct{}

func (Organization) Associate

func (Organization) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Organization) Disassociate

func (Organization) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Organization) Read

func (Organization) Read(user common.User, organization common.Organization) bool

func (Organization) Write

func (Organization) Write(user common.User, organization common.Organization) bool

func (Organization) WriteByID

func (o Organization) WriteByID(user common.User, organizationID bson.ObjectId) bool

type Project

type Project struct{}

func (Project) Associate

func (Project) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Project) Disassociate

func (Project) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Project) Read

func (Project) Read(user common.User, project common.Project) bool

func (Project) ReadByID

func (p Project) ReadByID(user common.User, projectID bson.ObjectId) bool

func (Project) Update

func (Project) Update(user common.User, project common.Project) bool

func (Project) Write

func (Project) Write(user common.User, project common.Project) bool

type Team

type Team struct{}

func (Team) Associate

func (Team) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Team) Disassociate

func (Team) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (Team) Read

func (Team) Read(user common.User, team common.Team) bool

func (Team) Write

func (Team) Write(user common.User, team common.Team) bool

type TerraformJobTemplate

type TerraformJobTemplate struct{}

func (TerraformJobTemplate) Associate

func (TerraformJobTemplate) Associate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (TerraformJobTemplate) Disassociate

func (TerraformJobTemplate) Disassociate(resourceID bson.ObjectId, grantee bson.ObjectId, roleType string, role string) (err error)

func (TerraformJobTemplate) Read

func (TerraformJobTemplate) Read(user common.User, jtemplate terraform.JobTemplate) bool

func (TerraformJobTemplate) ReadByID

func (j TerraformJobTemplate) ReadByID(user common.User, templateID bson.ObjectId) bool

func (TerraformJobTemplate) Write

func (TerraformJobTemplate) Write(user common.User, jtemplate terraform.JobTemplate) bool

func (TerraformJobTemplate) WriteByID

func (j TerraformJobTemplate) WriteByID(user common.User, templateID bson.ObjectId) bool

type User

type User struct{}

func (User) Read

func (User) Read(user common.User, object common.User) bool

func (User) Write

func (User) Write(user common.User, object common.User) bool

func (User) WriteSpecial

func (User) WriteSpecial(user common.User, object common.User) bool

Jump to

Keyboard shortcuts

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