39 lines
829 B
Go
39 lines
829 B
Go
package constants
|
|
|
|
type PermissionType string
|
|
|
|
const (
|
|
Balance PermissionType = "balance"
|
|
Vacancies PermissionType = "vacancies"
|
|
Employees PermissionType = "employees"
|
|
Profile PermissionType = "profile"
|
|
Company PermissionType = "company"
|
|
Submissions PermissionType = "submissions"
|
|
)
|
|
|
|
func (p PermissionType) String() string {
|
|
return string(p)
|
|
}
|
|
|
|
type PermissionValue string
|
|
|
|
const (
|
|
NoPermission PermissionValue = "no_permission"
|
|
CanView PermissionValue = "can_view"
|
|
CanEdit PermissionValue = "can_edit"
|
|
)
|
|
|
|
func (p PermissionValue) String() string {
|
|
return string(p)
|
|
}
|
|
|
|
var PermissionLevels = map[PermissionValue]int{
|
|
NoPermission: 1,
|
|
CanView: 2,
|
|
CanEdit: 3,
|
|
}
|
|
|
|
var AllPermissions = []PermissionType{
|
|
Vacancies, Balance, Company, Submissions, Profile, Employees, Submissions,
|
|
}
|