Documentation
¶
Index ¶
- func CreateToken(auth *auth.Client, ctx context.Context, userId, phoneNumber string, ...) (string, error)
- func RevokeToken(auth *auth.Client, ctx context.Context, userId string) error
- type Roles
- type User
- func (it *User) IsBranchAdmin() bool
- func (it *User) IsCourier() bool
- func (it *User) IsCustomer() bool
- func (it *User) IsFinanceAdmin() bool
- func (it *User) IsFoodServiceAM() bool
- func (it *User) IsFoodServiceGM() bool
- func (it *User) IsFoodServiceNSM() bool
- func (it *User) IsFoodServiceRM() bool
- func (it *User) IsFoodServiceSales() bool
- func (it *User) IsRetailAM() bool
- func (it *User) IsRetailDir() bool
- func (it *User) IsRetailGM() bool
- func (it *User) IsRetailRM() bool
- func (it *User) IsRetailSales() bool
- func (it *User) IsSalesAdmin() bool
- func (it *User) IsSystemAdmin() bool
- func (it *User) IsWalkInCustomer() bool
- func (it *User) IsWarehouseAdmin() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Roles ¶
type Roles string
const ( FOOD_SERVICE_GM Roles = "FOOD-SERVICE-GM" FOOD_SERVICE_NSM Roles = "FOOD-SERVICE-NSM" FOOD_SERVICE_RM Roles = "FOOD-SERVICE-RM" FOOD_SERVICE_AM Roles = "FOOD-SERVICE-AM" FOOD_SERVICE_SALES Roles = "FOOD-SERVICE-SALES" RETAIL_DIR Roles = "RETAIL-DIR" RETAIL_GM Roles = "RETAIL-GM" RETAIL_RM Roles = "RETAIL-RM" RETAIL_AM Roles = "RETAIL-AM" RETAIL_SALES Roles = "RETAIL-SALES" SYSTEM_ADMIN Roles = "SYSTEM-ADMIN" BRANCH_ADMIN Roles = "BRANCH-ADMIN" SALES_ADMIN Roles = "SALES-ADMIN" FINANCE_ADMIN Roles = "FINANCE-ADMIN" WAREHOUSE_ADMIN Roles = "WAREHOUSE-ADMIN" COURIER Roles = "COURIER" CUSTOMER Roles = "CUSTOMER" WALK_IN_CUSTOMER Roles = "WALK-IN-CUSTOMER" )
type User ¶
type User struct { Id string `json:"user_id"` PhoneNumber string `json:"phoneNumber"` Roles string `json:"roles"` Region []string `json:"region"` Iss string `json:"iss"` Aud string `json:"aud"` AuthTime int64 `json:"auth_time"` Sub string `json:"sub"` Iat int64 `json:"iat"` Exp int64 `json:"exp"` }
func ValidateToken ¶
Validate Token
func (*User) IsBranchAdmin ¶
check is user roles is Branch Admin
func (*User) IsFinanceAdmin ¶
check is user roles is Finance Admin
func (*User) IsFoodServiceAM ¶
check is user roles is AM food service
func (*User) IsFoodServiceGM ¶
check is user roles is GM food service
func (*User) IsFoodServiceNSM ¶
check is user roles is NSM food service
func (*User) IsFoodServiceRM ¶
check is user roles is RM food service
func (*User) IsFoodServiceSales ¶
check is user roles is Sales food service
func (*User) IsRetailSales ¶
check is user roles is Sales Retail
func (*User) IsSystemAdmin ¶
check is user roles is System Admin
func (*User) IsWalkInCustomer ¶
check is user roles is Walk In Customer Admin
func (*User) IsWarehouseAdmin ¶
check is user roles is Warehouse Admin
Click to show internal directories.
Click to hide internal directories.