///<summary> ///Gets the permissions for the desired api key. ///</summary> ///<param name="apikey">The key to check</param> ///<returns>List of strings that contains all permissions for that key</returns> public List <string> getPermissions(string apikey) { if (permissions != null) { return(permissions.permissions); } else { permissions = requestJSON <KeyPermissions>(URL + apikey); } return(permissions.permissions); }
///<summary> ///Gets the permissions for the attached api key. ///</summary> ///<exception cref="Exceptions.APIKeyNotFoundException">Thrown if the current object does not contain the APIKeyInfoComponent.</exception> ///<returns>List of strings that contains all permissions for that key</returns> public List <string> getPermissions() { if (GetComponent <APIKeyInfoComponent>() == null) { throw new Exceptions.APIKeyNotFoundException(); } if (permissions != null) { return(permissions.permissions); } else { permissions = requestJSON <KeyPermissions>(URL + GetComponent <APIKeyInfoComponent>().getAPIKey()); } return(permissions.permissions); }
/// <summary> /// Updates the component information. /// </summary> public override void update() { //to force update permissions = null; getPermissions(); }