public Models.DatabaseList GetDatabases(string UserName, string Password, string domain = "") { Models.DatabaseList DatabaseList = new Models.DatabaseList(); try { var api = new Requests.ConnectorApi(ConfigurationManager.AppSettings["Square9Api"], domain + @"\" + UserName, Password); DatabaseList = api.Requests.UserRequests.GetDatabaseList(); } catch (Exception ex) { throw new Exception("Unable to return list of Secured Users: " + ex.Message); } return(DatabaseList); }
public Models.License GetLicense(string UserName, string Password, string domain = "") { Models.License license = new Models.License(); try { var api = new Requests.ConnectorApi(ConfigurationManager.AppSettings["Square9Api"], domain + @"\" + UserName, Password); license = api.Requests.Licenses.GetLicense(); } catch (Exception ex) { throw new Exception("Unable to return list of Secured Users: " + ex.Message); } return(license); }
public List <Models.SecurityNode> GetSecuredUsersTree(string domain, string UserName, string Password) { List <Models.SecurityNode> SecuredUsers = new List <Models.SecurityNode>(); try { var api = new Requests.ConnectorApi(ConfigurationManager.AppSettings["Square9Api"], domain + @"\" + UserName, Password); var license = api.Requests.Licenses.GetLicense(); SecuredUsers = api.Requests.UserRequests.GetUsersAndGroupsTree(license.Token); api.Requests.Licenses.ReleaseLicense(license.Token); } catch (Exception ex) { throw new Exception("Unable to return list of Secured Users: " + ex.Message); } return(SecuredUsers); }
public List <String> GetGroupUsers(String DomainOrServerName, String GroupName, bool domain) { List <String> Users = new List <String>(); try { var api = new Requests.ConnectorApi(ConfigurationManager.AppSettings["Square9Api"], domain + @"\" + UserName, Password); var license = api.Requests.Licenses.GetLicense(); Users = api.Requests.UserRequests.GetUserGroups(DomainOrServerName, GroupName, domain); api.Requests.Licenses.ReleaseLicense(license.Token); } catch (Exception ex) { throw new Exception("Unable to return list of Secured Users: " + ex.Message); } return(Users); }
public int GetUserArchiveSecurity(String domain, Int32 DatabaseId, Int32 ArchiveId, String User, String UserName, String Password) { var security = 0; try { var api = new Requests.ConnectorApi(ConfigurationManager.AppSettings["Square9Api"], domain + @"\" + UserName, Password); var license = api.Requests.Licenses.GetLicense(); security = api.Requests.UserRequests.GetUserArchiveSecurity(DatabaseId, ArchiveId, User, license.Token); api.Requests.Licenses.ReleaseLicense(license.Token); } catch (Exception ex) { throw new Exception("Unable to return list of Secured Users: " + ex.Message); } return(security); }