Add rights to ACL for specified entity (collection, path, etc.).

    Creates if necessary.

def access_grant(tp, name, cid, uid, perm, **kwargs):
    """
    Add rights to ACL for specified entity (collection, path, etc.).

    Creates if necessary.
    """
    ctx = Context(**kwargs)
    ctx.execute_action('access:edit:grant', **{
        'unicat': ctx.repo.create_secure_service('unicat'),
        'tp': tp,
        'name': name,
        'cids': cid,
        'uids': uid,
        'perm': perm,
    })