Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Dotcom site admin RoleDotcomSiteAdmin = ToRole(services.Dotcom, "site_admin") )
services.Dotcom
var ( // Enterprise Portal customer admin RoleEnterprisePortalCustomerAdmin = ToRole(services.EnterprisePortal, "customer_admin") )
services.EnterprisePortal
var ( // SSC admin RoleSSCAdmin = ToRole(services.SSC, "admin") )
services.SSC
var (
RoleWorkspacesServiceAdmin = ToRole(services.Workspaces, "service_admin")
)
services.Workspaces
Functions ¶
func ByResourceType ¶
func ByResourceType() map[ResourceType][]Role
ByResourceType returns all allowed roles grouped by resource type.
func ServiceRolesByService ¶
ServiceRolesByService returns all allowed service roles grouped by service.
Types ¶
type ResourceType ¶
type ResourceType string
ResourceType is the type of resource that a role is associated with.
const ( // Service type is a special type used for service level roles. Service ResourceType = "service" // Subscription resources for Enterprise Portal. EnterpriseSubscription ResourceType = "enterprise_subscription" )
func ResourceTypes ¶
func ResourceTypes() []ResourceType
ResourceTypes returns all allowed resource types.
func (ResourceType) DisplayName ¶
func (r ResourceType) DisplayName() string
DisplayName returns the display name of the resource type.
func (ResourceType) IsService ¶
func (r ResourceType) IsService() bool
IsService returns true if the resource type is a service. This is a special helper function as service level roles have special handling.
type Role ¶
type Role string
Role is always the full qualified role name, e.g. "dotcom::site_admin".
func ToRole ¶
ToRole returns a role string in the format of "service::role", which comprises a fully qualified role name.
func ToRoles ¶
ToRoles converts a list of strings to a list of roles. It does not validate each input value.
func (Role) ResourceType ¶
func (r Role) ResourceType() ResourceType
ResourceType returns the resource type that the role is associated with. If the role is not registered, it returns "unknown".