Skip to content
Snippets Groups Projects
Unverified Commit 2ecfd7b0 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Gatekeep those new SET commands

parent 59351d54
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,9 @@ func ActionSetNobrief(_ *dclish.Command) error { ...@@ -69,6 +69,9 @@ func ActionSetNobrief(_ *dclish.Command) error {
// ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command. // ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command.
func ActionSetDefaultExpire(cmd *dclish.Command) error { func ActionSetDefaultExpire(cmd *dclish.Command) error {
if this.User.Admin == 0 {
return errors.New("You are not an admin")
}
value, err := strconv.ParseInt(cmd.Args[0], 10, 64) value, err := strconv.ParseInt(cmd.Args[0], 10, 64)
if err != nil { if err != nil {
return err return err
...@@ -79,7 +82,9 @@ func ActionSetDefaultExpire(cmd *dclish.Command) error { ...@@ -79,7 +82,9 @@ func ActionSetDefaultExpire(cmd *dclish.Command) error {
// ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command. // ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command.
func ActionSetExpireLimit(cmd *dclish.Command) error { func ActionSetExpireLimit(cmd *dclish.Command) error {
fmt.Println("TODO: implement ActionSetExpireLimit.") if this.User.Admin == 0 {
return errors.New("You are not an admin")
}
value, err := strconv.ParseInt(cmd.Args[0], 10, 64) value, err := strconv.ParseInt(cmd.Args[0], 10, 64)
if err != nil { if err != nil {
return err return err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment