def get_perm_by_code(perm_code,**kwargs):
    """
        Get a permission by its code
    """

    try:
        perm = db.DBSession.query(Perm).filter(Perm.code==perm_code).one()
        return perm
    except NoResultFound:
        raise ResourceNotFoundError("Permission not found (perm_code={})".format(perm_code))
def get_perm_by_code ( perm_code , ** kwargs ) : try : perm = db . DBSession . query ( Perm ) . filter ( Perm . code == perm_code ) . one ( ) return perm except NoResultFound : raise ResourceNotFoundError ( "Permission not found (perm_code={})" . format ( perm_code ) )
Get a permission by its code