public static async Task<CloudRole> GetRole(string roleName) { var result = await Util.CloudRequest.POST("/role/getRole/" + roleName, null); var role = new CloudRole(roleName); role.dictionary = (Dictionary<string, Object>)result; return role; }
public bool IsInRole(CloudRole role) { if (role == null || role.GetType() != typeof(CloudRole)) { throw new Exception.CloudBoostException("Role is null or its not of type CloudRole"); } return(((ArrayList)(this.Get("roles"))).IndexOf(role.ID) >= 0); }
public static async Task <CloudRole> GetRole(string roleName) { var result = await Util.CloudRequest.Send <Dictionary <string, Object> >(Util.CloudRequest.Method.POST, "/role/getRole/" + roleName, null); var role = new CloudRole(roleName); role.dictionary = result; return(role); }
public async Task <CloudUser> RemoveFromRoleAsync(CloudRole role) { if (this.ID == null) { throw new CloudBoostException("Please save this user before you remove it from the role"); } Dictionary <string, Object> postData = new Dictionary <string, object>(); postData.Add("user", this); postData.Add("role", role); var result = await Util.CloudRequest.Send <CloudRole>(Util.CloudRequest.Method.PUT, CB.CloudApp.ApiUrl + "/user/" + CB.CloudApp.AppID + "/removeFromRole", postData); this.dictionary = result.dictionary; return(this); }
public async Task<CloudUser> RemoveFromRole(CloudRole role) { if (this.ID == null) { throw new CloudBoostException("Please save this user before you remove it from the role"); } Dictionary<string, Object> postData = new Dictionary<string, object>(); postData.Add("user", this); postData.Add("role", role); var result = await Util.CloudRequest.POST("/user/removeFromRole", postData); this.dictionary = (Dictionary<string, Object>)result; return this; }
public bool IsInRole(CloudRole role) { if (role == null || role.GetType() != typeof(CloudRole)) { throw new Exception.CloudBoostException("Role is null or its not of type CloudRole"); } return (((ArrayList)(this.Get("roles"))).IndexOf(role.ID) >= 0); }