restructured checkRights() in DBManager for readability