Documentation ¶
Index ¶
- type Service
- func (s *Service) AccountCreate(c *gin.Context, roleID, companyID, locationID int) bool
- func (s *Service) EnforceCompany(c *gin.Context, ID int) bool
- func (s *Service) EnforceLocation(c *gin.Context, ID int) bool
- func (s *Service) EnforceRole(c *gin.Context, r model.AccessRole) bool
- func (s *Service) EnforceUser(c *gin.Context, ID int) bool
- func (s *Service) IsLowerRole(c *gin.Context, r model.AccessRole) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is RBAC application service
func (*Service) AccountCreate ¶
AccountCreate performs auth check when creating a new account Location admin cannot create accounts, needs to be fixed on EnforceLocation function
func (*Service) EnforceCompany ¶
EnforceCompany checks whether the request to apply change to company data is done by the user belonging to the that company and that the user has role CompanyAdmin. If user has admin role, the check for company doesnt need to pass.
func (*Service) EnforceLocation ¶
EnforceLocation checks whether the request to change location data is done by the user belonging to the requested location
func (*Service) EnforceRole ¶
EnforceRole authorizes request by AccessRole
func (*Service) EnforceUser ¶
EnforceUser checks whether the request to change user data is done by the same user