Skip to content

Commit

Permalink
Merge bda55e4 into 0b6d1dc
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyqs committed Feb 12, 2020
2 parents 0b6d1dc + bda55e4 commit 0e2737e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
2 changes: 0 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ type Permissions struct {

// Validate the pub and sub fields in the permissions list
func (p *Permissions) Validate(vr *ValidationResults) {
p.Pub.Validate(vr)
p.Sub.Validate(vr)
if p.Resp != nil {
p.Resp.Validate(vr)
}
Expand Down
36 changes: 0 additions & 36 deletions user_claims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,42 +227,6 @@ func TestUserValidation(t *testing.T) {
if vr.IsEmpty() || len(vr.Issues) != 1 || !vr.IsBlocking(true) {
t.Error("bad limit should be invalid")
}

uc.Limits.Times = []TimeRange{}
uc.Permissions.Pub.Allow.Add("bad subject")
vr = CreateValidationResults()
uc.Validate(vr)

if vr.IsEmpty() || len(vr.Issues) != 1 || !vr.IsBlocking(true) {
t.Error("bad permission should be invalid")
}

uc.Permissions.Pub.Allow.Remove("bad subject")
uc.Permissions.Sub.Allow.Add("bad subject")
vr = CreateValidationResults()
uc.Validate(vr)

if vr.IsEmpty() || len(vr.Issues) != 1 || !vr.IsBlocking(true) {
t.Error("bad permission should be invalid")
}

uc.Permissions.Sub.Allow.Remove("bad subject")
uc.Permissions.Pub.Deny.Add("bad subject")
vr = CreateValidationResults()
uc.Validate(vr)

if vr.IsEmpty() || len(vr.Issues) != 1 || !vr.IsBlocking(true) {
t.Error("bad permission should be invalid")
}

uc.Permissions.Pub.Deny.Remove("bad subject")
uc.Permissions.Sub.Deny.Add("bad subject")
vr = CreateValidationResults()
uc.Validate(vr)

if vr.IsEmpty() || len(vr.Issues) != 1 || !vr.IsBlocking(true) {
t.Error("bad permission should be invalid")
}
}

func TestUserAccountID(t *testing.T) {
Expand Down

0 comments on commit 0e2737e

Please sign in to comment.