This commit is contained in:
withchao
2023-01-17 17:43:30 +08:00
parent 142b9386fc
commit 8e47b55ab4
4 changed files with 28 additions and 10 deletions
+7
View File
@@ -173,6 +173,13 @@ func CheckAccessV3(ctx context.Context, OwnerUserID string) (err error) {
return constant.ErrIdentity.Wrap(utils.GetSelfFuncName())
}
func CheckAdmin(ctx context.Context) error {
if utils.IsContain(tools.OpUserID(ctx), config.Config.Manager.AppManagerUid) {
return nil
}
return constant.ErrIdentity.Wrap()
}
func GetUserIDFromToken(token string, operationID string) (bool, string, string) {
claims, err := ParseToken(token, operationID)
if err != nil {