1 Star 1 Fork 1

xiaoyutab / xgotool

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
check_auth.go 389 Bytes
Copy Edit Raw Blame History
package xauth
import "gitee.com/xiaoyutab/xgotool"
// 检测用户是否存在某权限
//
// uid 用户ID
// auth 权限标识
// typ 权限标识来源
func CheckAuth(uid uint, auth string, typ uint) bool {
if uid == 0 {
return false
}
if uid == 1 {
return true
}
auths := GetUserAuth(uid, typ)
if len(auths) == 0 {
return false
}
return xgotool.InArray(auth, auths)
}
Go
1
https://gitee.com/xiaoyutab/xgotool.git
git@gitee.com:xiaoyutab/xgotool.git
xiaoyutab
xgotool
xgotool
v0.3.13

Search