fix bug
This commit is contained in:
		
							parent
							
								
									76fd17c0f0
								
							
						
					
					
						commit
						25ecea7e09
					
				|  | @ -7,7 +7,6 @@ import ( | ||||||
| 	"git.apinb.com/bsm-sdk/engine/encipher" | 	"git.apinb.com/bsm-sdk/engine/encipher" | ||||||
| 	"git.apinb.com/bsm-sdk/engine/exception" | 	"git.apinb.com/bsm-sdk/engine/exception" | ||||||
| 	"git.apinb.com/bsm-sdk/engine/types" | 	"git.apinb.com/bsm-sdk/engine/types" | ||||||
| 	"git.apinb.com/bsm-sdk/engine/utils" |  | ||||||
| 	"google.golang.org/grpc/metadata" | 	"google.golang.org/grpc/metadata" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -38,11 +37,6 @@ func ParseMetaCtx(ctx context.Context, opts *ParseOptions) (*types.JwtClaims, er | ||||||
| 		if !strings.Contains(claims.Role, opts.RoleValue) { | 		if !strings.Contains(claims.Role, opts.RoleValue) { | ||||||
| 			return nil, exception.ErrPermissionDenied | 			return nil, exception.ErrPermissionDenied | ||||||
| 		} | 		} | ||||||
| 		if opts.MustPrivateAllow { |  | ||||||
| 			if utils.IsPublicIP(claims.Client) { |  | ||||||
| 				return nil, exception.ErrPermissionDenied |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return claims, nil | 	return claims, nil | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue