Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTenantId = "tenantId" DefaultUserId = "userId" NoAuthAdminTenantId = "adminTenantId" )
View Source
const (
KContext = "context"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { IsAdmin bool `policy:"true" json:"is_admin"` AuthToken string `policy:"true" json:"auth_token"` UserId string `policy:"true" json:"user_id"` TenantId string `policy:"true" json:"tenant_id"` DomainId string `policy:"true" json:"domain_id"` UserDomainId string `policy:"true" json:"user_domain_id"` ProjectDomainId string `policy:"true" json:"project_domain_id"` Roles []string `policy:"true" json:"roles"` UserName string `policy:"true" json:"user_name"` ProjectName string `policy:"true" json:"project_name"` DomainName string `policy:"true" json:"domain_name"` UserDomainName string `policy:"true" json:"user_domain_name"` ProjectDomainName string `policy:"true" json:"project_domain_name"` IsAdminTenant bool `policy:"true" json:"is_admin_tenant"` }
func GetContext ¶
func GetContext(req *restful.Request) *Context
func NewAdminContext ¶
func NewAdminContext() *Context
func NewContext ¶ added in v0.6.3
func NewContext() *Context
func NewContextFromJson ¶
func (*Context) ToPolicyValue ¶
Click to show internal directories.
Click to hide internal directories.