public HttpResponseMessage GetSecuredUserList(string DomainOrServerName, string UserName, string Password, string Secured = "secured") { List <Models.SecuredGroup> Users = new List <Models.SecuredGroup>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); Users = logic.GetSecuredUsers(DomainOrServerName, UserName, Password); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.Forbidden, "Unable to return the Secured Users List: " + ex.Message)); } return(Request.CreateResponse(HttpStatusCode.Forbidden, Users)); }
public HttpResponseMessage Get(string DomainOrServerName, string GroupName, bool Domain = true) { List <string> Users = new List <string>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); Users = logic.GetUsersOfGroup(DomainOrServerName, GroupName, Domain); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.Forbidden, "Unable to return the Secured Users Tree Results: " + ex.Message)); } return(Request.CreateResponse(HttpStatusCode.OK, Users)); }
public List <Models.SecuredGroup> GetSecuredUserList(string DomainOrServerName, string UserName, string Password, string Secured = "secured") { List <Models.SecuredGroup> Users = new List <Models.SecuredGroup>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); Users = logic.GetSecuredUsers(DomainOrServerName, UserName, Password); } catch (Exception) { throw; } return(Users); }
public List <Models.SecurityNode> GetUserTree(string DomainOrServerName, string UserName, string Password) { List <Models.SecurityNode> Users = new List <Models.SecurityNode>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); Users = logic.GetSecuredUsersTree(DomainOrServerName, UserName, Password); } catch (Exception) { throw; } return(Users); }
public List <string> Get(string DomainOrServerName, string GroupName, bool Domain = true) { List <string> Users = new List <string>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); Users = logic.GetUsersOfGroup(DomainOrServerName, GroupName, Domain); } catch (Exception) { throw; } return(Users); }
public List <Models.Permissions> GetAllDatabasePermissions(string DomainOrServerName, string UserName, string Password, int DatabaseID, bool domain = true) { List <Models.Permissions> permissions = new List <Models.Permissions>(); try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); permissions = logic.GetAllDatabasePermissions(DomainOrServerName, UserName, Password, DatabaseID, domain); } catch (Exception) { throw; } return(permissions); }
public HttpResponseMessage GetAllDatabasePermissions(int DatabaseID, bool isDomain = true) { List <Models.Permissions> permissions = new List <Models.Permissions>(); IEnumerable <string> headerValues; var authHeader = string.Empty; if (Request.Headers.TryGetValues("Authorization", out headerValues)) { authHeader = headerValues.FirstOrDefault(); } try { var logic = new Square9.SecurityDisplay.Logic.UsersLogic(); var authData = logic.GetAuthValues(authHeader); permissions = logic.GetAllDatabasePermissions(authData.Domain, authData.Username, authData.Password, DatabaseID, isDomain); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.Forbidden, "Unable to return permissions: " + ex.Message)); } return(Request.CreateResponse(HttpStatusCode.OK, permissions)); }