Using the UserCanAccessRequestOffering Web Method
3 min
checks if the current user is entitled to access the specified request offering request syntax public frsheatusercanaccessreqofferingresponse usercanaccessrequestoffering(string sessionkey, string tenantid, string loginid, string reqofferingname) parameters sessionkey the session key from the connect web method tenantid the tenant for which the session key is authenticated loginid the login id of the user reqofferingname the name of the request offering return value frsheatusercanaccessreqofferingresponse object, defined as follows public class frsheatusercanaccessreqofferingresponse { public string status { get; set; } public string exceptionreason { get; set; } public bool canaccess { get; set; } } the frsheatusercanaccessreqofferingresponse class has the following fields status provides a status about the state of the connection the table below contains a full description of the available status values exceptionreason contains exception information, if the application throws an exception when running this web method canaccess indicates if the user is entitled to access the specified request offering the following table lists the available status values and describes how to interpret them \<font color="#ffffff">status\</font>\<font color="#ffffff">explanation\</font> success successfully retrieved the user and request offering in the tenant review the canaccess field to determine if the specified user is entitled to access the request offering usernotfound the tenant does not contain a user record with the specified login id ensure that the login id is spelled correctly offeringnotfound the tenant does not contain a request offering with the specified name ensure that the name is spelled correctly error an error was encountered during the execution of this web method inspect the corresponding exceptionreason field to determine why the web method has failed example string loginid = "asimon"; string reqofferingname = "domain password reset"; frsheatusercanaccessreqofferingresponse canaccessreqofferingresponse = frsvc usercanaccessrequestoffering(sessionkey, tenantid, loginid, reqofferingname); if (canaccessreqofferingresponse status == "success") { if (canaccessreqofferingresponse canaccess) { console writeline("user can access the request offering ", loginid, reqofferingname); } else { console writeline("user has no access to the request offering ", loginid, reqofferingname); } }
