Search Permissions

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
Where is the best place, to check the permissions for own search handlers?

In the search controller it's only checking for the global search permissions
PHP:
		if (!XenForo_Visitor::getInstance()->canSearch())
		{
			throw $this->getNoPermissionResponseException();
		}

That's why i think that i have to check them in getSearchFormControllerResponse.
Is this ok, or is there a other place?
 
I believe you're looking for canViewResult().

Check line ~126 in XenForo_Search_DataHandler_Thread for example.
 
CanVIewResult runs AFAIK "while" the search, to see if a result can be shown or not.
So that's IMHO too late, if the user have no permission to "search my articles", why would he been allowed to use the search formular^^
 
I personally don't see significant value in preventing a user from searching specific types of content.
 
Why? if somebody isn't allowed to use the new contenttype (in my case article), IMHO he shouldn't be able to see the search form.
 
Sorry, I thought you meant a permission for searching articles.

Where you suggested makes the most sense.
 
Top Bottom