def _setauth(self): """Get and set authorization """ service = config.get("Authorization","service") if service.lower() == "liferay": # Get the JSESSIONID from Client's request # and create LaymanAuth instance based on that from auth import LaymanAuthLiferay JSESSIONID = web.cookies().get("JSESSIONID") self.auth = LaymanAuthLiferay(config) self.auth.authorise(JSESSIONID) elif service.lower() == "hsrs": from auth import LaymanAuthHSRS self.auth = LaymanAuthHSRS() elif service.lower() == "open": from auth import LaymanAuthOpen self.auth = LaymanAuthOpen() # NOTE: everybody can do anything by default # should be probabely fixed in the future else: from auth import LaymanAuth self.auth = LaymanAuth()