public CommonApiResponse <Jwt> CheckToken(Guid token) { CoreFaces.Helper.Result <Jwt> jwt = _iJwtService.CheckToken(token); if (jwt.Status) { return(CommonApiResponse <Jwt> .Create(Response, System.Net.HttpStatusCode.OK, true, jwt.Data, null)); } else { return(CommonApiResponse <Jwt> .Create(Response, System.Net.HttpStatusCode.OK, false, null, "Jwt not found.")); } }
public CommonApiResponse <UserRole> Post(Guid userId, Guid roleId) { jwt = ViewBag.Jwt; CoreFaces.Helper.Result <UserRole> result = _userRoleService.UserAddRole(jwt.UserId, userId, roleId); UserRole userRole = result.Data; UserRoleView _userRoleView = _userRoleService.UserRoleToUserRoleView(userRole); _userRoleView.Name = _roleService.GetById(userRole.RoleId).Name; //return CommonApiResponse<UserRole>.Create(Response, userRole, result); return(CommonApiResponse <UserRole> .Create(Response, System.Net.HttpStatusCode.OK, true, userRole, null)); }
public CommonApiResponse <string> Delete(PermissionCrudView permissionView) { jwt = ViewBag.Jwt; CoreFaces.Helper.Result <Permission> result = _permissionService.Delete(jwt.UserId, permissionView.Id); Permission p = result.Data; if (result.Status) { return(CommonApiResponse <string> .Create(Response, System.Net.HttpStatusCode.OK, true, "Success.", result.ErrorList)); } else { return(CommonApiResponse <string> .Create(Response, System.Net.HttpStatusCode.Conflict, false, null, result.ErrorList)); } }