def simple_grant(acl, role_id, permission): from allura.model.types import ACE for ace in acl: if ace.role_id == role_id and ace.permission == permission: return acl.append(ACE.allow(role_id, permission))