Forums / Developer / How to forbid access to several views

How to forbid access to several views

Author Message

Alex xxx

Sunday 08 June 2008 9:26:48 am

How to forbid access to unusable views for anonymous users? e.g. content/advancedsearch, user/register etc.
And how to learn what views are active?

Gaetano Giunta

Sunday 08 June 2008 10:20:41 am

You can disable access to a given set of modules or views via the siteaccessrules settings in site.ini: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/configuration_files/site_ini/siteaccessrules/rules

If you want a more granular level of access, the you have to set up permissions, roles and groups via the admin interface. eZ Publish uses a positive-permission-only model, so any view that is not specifically granted access to is forbidden.

The anon users are always all logged in with the same user, so you decide what they can do by giving permissions to that user. IIRC by default is has access to content/read in the 'standard' section, etc...

Keep in mind that you also have a module/view whitelist in site.ini (ie. things that can be accessed regardless of roles/perms): PolicyOmitList. By default in eZP 4 it reads:
olicyOmitList[]=user/login
PolicyOmitList[]=user/logout
PolicyOmitList[]=user/register
PolicyOmitList[]=user/activate
PolicyOmitList[]=user/success
PolicyOmitList[]=user/forgotpassword
PolicyOmitList[]=layout
PolicyOmitList[]=manual
PolicyOmitList[]=ezinfo
PolicyOmitList[]=paypal/notify_url

Principal Consultant International Business
Member of the Community Project Board

Alex xxx

Sunday 08 June 2008 1:58:13 pm

Thank you!
And one more question: how to disable unused content/view variants such as content/view/line, plain, text etc
I need only content/view/full

Sébastien Antoniotti

Monday 09 June 2008 2:49:14 am

Hi,

Take a look at your override.ini.append.php and try to comment/delete originals override rules for variant you don't want to use.

You can also keep this override and use an "error of view template", who will display the sitemap and an error message.

Seb.

eZ Publish Freelance
web : http://www.webaxis.fr