code: def resource_associate_permission(self, token, id, name, scopes, **kwargs):
          
          return self._realm.client.post(
              '{}/{}'.format(self.well_known['policy_endpoint'], id),
              data=self._get_data(name=name, scopes=scopes, **kwargs),
              headers=self.get_headers(token)
          )
docs: Associates a permission with a Resource.
  
          https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_authorization_uma_policy_api
  
          :param str token: client access token
          :param str id: resource id
          :param str name: permission name
          :param list scopes: scopes access is wanted
          :param str description:optional
          :param list roles: (optional)
          :param list groups: (optional)
          :param list clients: (optional)
          :param str condition: (optional)
          :rtype: dict