def _make_purchaser_request(purchase): k = KeystoneClient( settings.FIWARE_KEYSTONE_ENDPOINT, purchase.offering.owner_admin_user.userprofile.access_token) for app in purchase.offering.applications: k.set_purchaser_role(purchase.owner_organization.actor_id, app['id'], is_org=purchase.organization_owned)
def _make_app_request(user): # Build keystone client k = KeystoneClient(settings.FIWARE_KEYSTONE_ENDPOINT, user.userprofile.access_token) if user.userprofile.is_user_org(): resp = k.get_provider_apps(user.userprofile.actor_id) else: resp = k.get_organization_apps(user.userprofile.current_organization.actor_id) return resp
def _make_app_request(user): # Build keystone client k = KeystoneClient(settings.FIWARE_KEYSTONE_ENDPOINT, user.userprofile.access_token) if user.userprofile.is_user_org(): resp = k.get_provider_apps(user.userprofile.actor_id) else: resp = k.get_organization_apps( user.userprofile.current_organization.actor_id) return resp
def _make_purchaser_request(purchase): k = KeystoneClient(settings.FIWARE_KEYSTONE_ENDPOINT, purchase.offering.owner_admin_user.userprofile.access_token) for app in purchase.offering.applications: k.set_purchaser_role(purchase.owner_organization.actor_id, app['id'], is_org=purchase.organization_owned)