def request_role(self, org_id='', user_id='', role_name=''): """Requests for an role within an Org which must be accepted or denied as a separate process. A role of Member is automatically implied with successfull enrollment. Throws a NotFound exception if neither id is found. @param org_id str @param user_id str @param role_name str @retval request_id str @throws NotFound object with specified id does not exist """ param_objects = self._validate_parameters(org_id=org_id, user_id=user_id, role_name=role_name) if role_name == MEMBER_ROLE: raise BadRequest( "The Member User Role is already assigned with an enrollment to an Org" ) #Initiate request req_obj = NegotiateRequestFactory.create_role_request( org_id, user_id, role_name) req_id = self.request_handler.open_request(req_obj) return req_id
def request_role(self, org_id='', user_id='', role_name=''): """Requests for an role within an Org which must be accepted or denied as a separate process. A role of Member is automatically implied with successfull enrollment. Throws a NotFound exception if neither id is found. @param org_id str @param user_id str @param role_name str @retval request_id str @throws NotFound object with specified id does not exist """ param_objects = self._validate_parameters(org_id=org_id, user_id=user_id, role_name=role_name) if role_name == MEMBER_ROLE: raise BadRequest("The Member User Role is already assigned with an enrollment to an Org") #Initiate request req_obj = NegotiateRequestFactory.create_role_request(org_id, user_id, role_name) req_id = self.request_handler.open_request(req_obj) return req_id