Fixed and change logic of filtering table columns by permissions.