浏览代码

Update org_user.go

Add check for, if current role is ROLE_VIEWER, return true if the role I'm checking for is ROLE_VIEWER. Fixes #16092
Sai Ram Gupta 6 年之前
父节点
当前提交
6929593eb6
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pkg/models/org_user.go

+ 4 - 0
pkg/models/org_user.go

@@ -35,6 +35,10 @@ func (r RoleType) Includes(other RoleType) bool {
 	if r == ROLE_EDITOR {
 		return other != ROLE_ADMIN
 	}
+	
+	if r == ROLE_VIEWER {
+		return other == ROLE_VIEWER
+	}
 
 	return false
 }