Skip to content

Instantly share code, notes, and snippets.

View fconil's full-sized avatar

Françoise Conil fconil

View GitHub Profile
@fconil
fconil / instances-and-fields.py
Created August 2, 2021 09:23
Experimenting Oso for application authorization
"""
https://docs.osohq.com/python/getting-started/policies.html#instances-and-fields
The content of "instances.polar" is :
# A user that is an administrator may read any document.
allow(user, "read", document) if
user.admin = true;
# A user may read any document that they own.
@fconil
fconil / getHalLab.py
Created March 1, 2013 17:19
Simple try with SOAPpy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from SOAPpy import WSDL
# URI et namespace des web services HAL
url = "http://hal.archives-ouvertes.fr/ws/ref.php"
wsdlRefHAL = WSDL.Proxy("%s?wsdl" % url)
## Script (Python) "changeLanguage"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=folderPath="/foo", language="en"
##title=Change folder objects language with portal_catalog
##
# -*- coding: utf-8 -*-