def permissions_save_override(permittee_kw, model_func, create_perm, edit_perm, delete_perm):
    def save(self, *args, **kwargs):
        """
        Override the default save method to enforce permissions.
        """
        pk = getattr(self, "pk", None)
        if not pk:
            # it's a new instance being created
            must_have_permission(permittee_kw, model_func(), create_perm)
        else:
            must_have_permission(permittee_kw, self, edit_perm)
            
        super(model_func(), self).save(*args, **kwargs)
        
        if not pk:
            # it was just created so give creator edit permissions
            d = threadlocals.get_thread_locals()
            give_permission_to(
                edit_perm, self, d[permittee_kw], can_delegate=True)
            give_permission_to(
                delete_perm, self, d[permittee_kw], can_delegate=True)
    return save
Returns the current log level.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/permissions/utils.py/permissions_save_override--crossover with--dataset/ETHPy150Open datafolklabs/cement/cement/ext/ext_logging.py/LoggingLogHandler.get_level