filtering database filter according to user permission