/// <summary> /// 授权验证 /// </summary> /// <param name="operation">授权操作</param> /// <returns></returns> public static bool CheckAuthorization(AuthenticationUser <long> user, OperationDto operation) { if (operation == null || user == null) { return(false); } if (user.IsAdmin) { return(true); } var checkAuthDto = new CheckAuthorizationDto() { UserId = user.Id, Operation = operation }; return(operationAppService.CheckAuthorization(checkAuthDto)); }
/// <summary> /// 授权验证 /// </summary> /// <param name="checkAuthorizationDto">授权验证信息</param> /// <returns>返回授权是否验证通过</returns> public bool CheckAuthorization(CheckAuthorizationDto checkAuthorizationDto) { return(operationBusiness.CheckAuthorization(checkAuthorizationDto)); }
/// <summary> /// 授权验证 /// </summary> /// <param name="checkAuthorizationDto">授权验证信息</param> /// <returns>返回授权是否验证通过</returns> public bool CheckAuthorization(CheckAuthorizationDto checkAuthorizationDto) { return(operationService.CheckAuthorization(checkAuthorizationDto.MapTo <CheckAuthorizationParameter>())); }