# HG changeset patch # User Sylvain Thénault # Date 1276534745 -7200 # Node ID f4fc424747db837592f27a59cb332b3acc718738 # Parent d532fe79800b7dab0951ecc11df19cc85efde83e [security] SchemaRelation.has_perm grows to new arguments allowing to specify subject/object entity type when actual eid are not known, but their types are diff -r d532fe79800b -r f4fc424747db schema.py --- a/schema.py Mon Jun 14 18:58:06 2010 +0200 +++ b/schema.py Mon Jun 14 18:59:05 2010 +0200 @@ -471,10 +471,14 @@ assert action in ('read', 'add', 'delete') if 'fromeid' in kwargs: subjtype = session.describe(kwargs['fromeid'])[0] + elif 'frometype' in kwargs: + subjtype = kwargs.pop('frometype') else: subjtype = None if 'toeid' in kwargs: objtype = session.describe(kwargs['toeid'])[0] + elif 'toetype' in kwargs: + objtype = kwargs.pop('toetype') else: objtype = None if objtype and subjtype: