[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
--- 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: