Documentation ¶
Index ¶
- Constants
- type Config
- type RequestTokenValidator
- type Supervisior
- func (supervisior *Supervisior) CanAccess(token string, teamID int, unitType int, unitID int, attributeID int) (bool, error)
- func (supervisior *Supervisior) CanDelete(token string, teamID int, unitType int, unitID int, attributeID int) (bool, error)
- func (supervisior *Supervisior) CanManage(token string, teamID int, unitType int, unitID int, attributeID int) (bool, error)
- func (supervisior *Supervisior) CanManageSpecial(token string, teamID int, unitType int, unitID int, attributeID int) (bool, error)
- func (supervisior *Supervisior) CanModify(token string, teamID int, unitType int, unitID int, attributeID int, ...) (bool, error)
- func (supervisior *Supervisior) GetTeamByIdentifier(targetTeamIdentifier string) (string, error)
- func (supervisior *Supervisior) GetTeamPermissions(teamID int) (string, error)
- func (supervisior *Supervisior) GetUser(targetUserID int) (string, error)
- func (supervisior *Supervisior) ValidateUserAccount(token string) (bool, error)
Constants ¶
View Source
const ( BASEURL = "http://127.0.0.1:9001/api/v1" // access control part VALIDATE_USER_ACCOUNT = "/accessControl/account/validateResult" GET_TEAM_PERMISSIONS = "/accessControl/teams/%s/permissions" CAN_ACCESS = "/accessControl/teams/%s/unitType/%s/unitID/%s/attribute/canAccess/%s" CAN_MANAGE = "/accessControl/teams/%s/unitType/%s/unitID/%s/attribute/canManage/%s" CAN_MANAGE_SPECIAL = "/accessControl/teams/%s/unitType/%s/unitID/%s/attribute/canManageSpecial/%s" CAN_MODIFY = "/accessControl/teams/%s/unitType/%s/unitID/%s/attribute/canModify/%s/from/%s/to/%s" CAN_DELETE = "/accessControl/teams/%s/unitType/%s/unitID/%s/attribute/canDelete/%s" // data control part GET_USER = "/dataControl/users/%s" GET_TEAM_BY_IDENTIFIER = "/dataControl/teams/byIdentifier/%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type RequestTokenValidator ¶
type RequestTokenValidator struct {
Config *Config
}
func NewRequestTokenValidator ¶
func NewRequestTokenValidator() (*RequestTokenValidator, error)
func (*RequestTokenValidator) GenerateValidateToken ¶
func (r *RequestTokenValidator) GenerateValidateToken(input ...string) string
func (*RequestTokenValidator) GenerateValidateTokenBySliceParam ¶
func (r *RequestTokenValidator) GenerateValidateTokenBySliceParam(input []string) string
type Supervisior ¶
type Supervisior struct { Config *Config Validator *RequestTokenValidator }
func NewSupervisior ¶
func NewSupervisior() (*Supervisior, error)
func (*Supervisior) CanManageSpecial ¶
func (*Supervisior) GetTeamByIdentifier ¶
func (supervisior *Supervisior) GetTeamByIdentifier(targetTeamIdentifier string) (string, error)
func (*Supervisior) GetTeamPermissions ¶
func (supervisior *Supervisior) GetTeamPermissions(teamID int) (string, error)
func (*Supervisior) GetUser ¶
func (supervisior *Supervisior) GetUser(targetUserID int) (string, error)
func (*Supervisior) ValidateUserAccount ¶
func (supervisior *Supervisior) ValidateUserAccount(token string) (bool, error)
Click to show internal directories.
Click to hide internal directories.