Ver código fonte

Backend: Remove redundant condition of `ROLE_VIEWER` (#19211)

Masudur Rahman 6 anos atrás
pai
commit
a41a7ea656
1 arquivos alterados com 1 adições e 5 exclusões
  1. 1 5
      pkg/models/org_user.go

+ 1 - 5
pkg/models/org_user.go

@@ -36,11 +36,7 @@ func (r RoleType) Includes(other RoleType) bool {
 		return other != ROLE_ADMIN
 	}
 
-	if r == ROLE_VIEWER {
-		return other == ROLE_VIEWER
-	}
-
-	return false
+	return r == other
 }
 
 func (r *RoleType) UnmarshalJSON(data []byte) error {