Added checkPrivileges Middleware