I'm developing a D8 site. I am using a custom views plugin to query data from a remote api by searching a business ID.

My scenario: User is only allowed to enter input of 3 attempts of business ID in a search view. If 3 attempts fails, I want to hide the views UI from the page for 24 hours. What's my purpose? To give difficulty for others to guess my business ID.

I wasn't able to implement it using Rules, and I'm guessing if we can do it on front-end coding.

Does anyone have an idea to implement this? Thanks!

Comments

johnreytanquinco created an issue. See original summary.

Lendude’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.3.x-dev
Component: User interface » views.module
Category: Task » Support request
Status: Active » Closed (works as designed)
Issue tags: -views, -views plugins

Moving to the core Views queue.

Frontend code won't help because anybody can just disable it client side and work around your 'security'.

Backend you could write a custom Views access handler (extend \Drupal\views\Plugin\views\access\AccessPluginBase and add your logic to that) and use that on your View.

Hope that helps.