<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_perm(perm_id,**kwargs):
 """ Delete a permission """


    #check_perm(kwargs.get('user_id'), 'edit_perm')
    try:
        perm_i = db.DBSession.query(Perm).filter(Perm.id==perm_id).one()
        db.DBSession.delete(perm_i)
    except InvalidRequestError:
        raise ResourceNotFoundError("Permission (id=%s) does not exist"%(perm_id))

    return 'OK'