-
Notifications
You must be signed in to change notification settings - Fork 1
/
policy.go
18 lines (15 loc) · 1.08 KB
/
policy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package policy
// Policy is a set of dynamic values that could be edited in runtime. Policy is typically propagated between scoretrak instances via pkg/policy/policyclient
type Policy struct {
ID uint `json:"-" gorm:"primary_key;"`
AllowUnauthenticatedUsers *bool `json:"allow_unauthenticated_users" gorm:"not null;default:true"`
AllowChangingUsernamesAndPasswords *bool `json:"allow_changing_usernames_and_passwords" gorm:"not null;default:false"`
AllowRedTeamLaunchingServiceTestsManually *bool `json:"allow_red_team_launching_service_tests_manually" gorm:"not null;default:false"`
ShowPoints *bool `json:"allow_to_see_points" gorm:"not null;default:true"`
ShowAddresses *bool `json:"show_addresses" gorm:"not null;default:true"`
}
func NewPolicy() *Policy {
tru := true
fls := false
return &Policy{ID: 1, AllowUnauthenticatedUsers: &tru, AllowChangingUsernamesAndPasswords: &fls, AllowRedTeamLaunchingServiceTestsManually: &fls, ShowPoints: &tru, ShowAddresses: &tru}
}