This commit is contained in:
withchao
2023-01-12 18:03:07 +08:00
parent fd8dd47d2a
commit 6641637f12
3 changed files with 22 additions and 8 deletions
+4 -4
View File
@@ -143,11 +143,11 @@ func IsManagerUserID(OpUserID string) bool {
}
}
func CheckManagerUserID(ctx context.Context) error {
if utils.IsContain(tools.OpUserID(ctx), config.Config.Manager.AppManagerUid) {
func CheckManagerUserID(ctx context.Context, userID string) error {
if utils.IsContain(userID, config.Config.Manager.AppManagerUid) {
return nil
}
return constant.ErrIdentity.Wrap(utils.GetSelfFuncName())
return constant.ErrNoPermission.Wrap()
}
func CheckAccess(ctx context.Context, OpUserID string, OwnerUserID string) bool {
@@ -184,7 +184,7 @@ func CheckAccessV3(ctx context.Context, OwnerUserID string) (err error) {
if opUserID == OwnerUserID {
return nil
}
return utils.Wrap(constant.ErrIdentity, open_utils.GetSelfFuncName())
return constant.ErrIdentity.Wrap(utils.GetSelfFuncName())
}
func GetUserIDFromToken(token string, operationID string) (bool, string, string) {