[abac] Add function ot extract assertion data from profile
This commit is contained in:
parent
cdb69c7301
commit
4440d06315
|
@ -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:
|
||||
|
|
Reference in New Issue