1
This commit is contained in:
38
internal/constants/permissions.go
Normal file
38
internal/constants/permissions.go
Normal file
@@ -0,0 +1,38 @@
|
||||
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,
|
||||
}
|
Reference in New Issue
Block a user