[abac] Add function ot extract assertion data from profile

This commit is contained in:
Mikaël Ates 2011-09-20 17:33:54 +02:00
parent cdb69c7301
commit 4440d06315
1 changed files with 9 additions and 0 deletions

View File

@ -950,6 +950,15 @@ def load_profile_by_dic(profile, dic):
% (str(source), str(dic[source])))
def get_assertions_from_definition(profile, definition, source=None):
if not source:
return [a for a in profile.assertions.all() \
if a.definition.id == definition.id]
return [a for a in profile.assertions.all() \
if a.definition.id == definition.id \
and a.source.id == source.id]
@transaction.commit_manually
def remove_predicate(predicate):
try: