• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Search Permissions

R

ragtek

Guest
#1
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?
 
R

ragtek

Guest
#3
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^^
 

Mike

XenForo developer
Staff member
#4
I personally don't see significant value in preventing a user from searching specific types of content.
 
R

ragtek

Guest
#5
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.
 

Mike

XenForo developer
Staff member
#6
Sorry, I thought you meant a permission for searching articles.

Where you suggested makes the most sense.