/// <summary> /// 授权验证 /// </summary> /// <param name="auth">授权验证信息</param> /// <returns></returns> public bool Authentication(AuthenticationCmdDto auth) { if (auth == null) { return(false); } return(authorizeService.Authentication(auth.MapTo <Authentication>())); }
/// <summary> /// 授权验证 /// </summary> /// <param name="operation">授权操作</param> /// <returns></returns> public static async Task <bool> AuthorizationAsync(AuthenticationUser <long> user, AuthorityOperationCmdDto operation) { if (operation == null || user == null) { return(false); } AuthenticationCmdDto authInfo = new AuthenticationCmdDto() { Operation = operation, User = new AdminUserCmdDto() { UserType = UserType.管理账户, SysNo = user.Id } }; return(await Task.Run(() => { return operation.Instance <IAuthService>().Authentication(authInfo); }).ConfigureAwait(false)); }
/// <summary> /// 授权验证 /// </summary> /// <param name="auth">授权验证信息</param> /// <returns></returns> public bool Authentication(AuthenticationCmdDto auth) { return(authBusiness.Authentication(auth)); }