def mk_perm(name, *groups): perm = model.Permission.find(name) if perm is None: log.debug("Creating permission: %s" % name) perm = model.Permission(name) model.meta.Session.add(perm) perm.groups = list(groups) return perm
def mk_perm(name): perm = model.Permission.find(name) if perm is None: log.debug("Creating permission: %s" % name) perm = model.Permission(name) model.meta.Session.add(perm) return perm return None