Monday 24 August 2009 10:25:10 am
Ok, I think I figured this out. Am going to post what I did for future reference and for those who need a "For Dummies" approach like I do :0)
<b>THE GOAL</b> Restrict access to certain areas of the website based on the user role. I am going to restrict access to anonymous users. I can deny them the site entirely or keep them from viewing specific areas. So that when a random visitor stumbles upon my site, they will be prompted to login/register. NOTE: If you restrict some but not all of the site, the <b>LINKS TO THE AREAS</b> that you restrict do not show. I read somewhere that you can allow anonymous users to view the links but once they click, they will be prompted to login/register. I'll have to figure that out later but anyhoo... Also, it helps to think of this as PERMITTING access to certain areas rather than <i>Restricting</i> access. In reality, you will be permitting the user to view certain areas and any area you don't add is by default, restricted from viewing by un-registered in visitors. this assumes you have ez publish installed in a folder called - ezpublish_dir. change to suit your site. this also assumes that during install, you named your administrative section "super." change to suit your site.
1. First navigate to Setup - Sections. <b>ezpublish_dir</b>/index.php?/<b>super</b>/section/list
2. Verify the default values. The following are automatic with a fresh ez pub install. An explaination of some of these values can be found here... http://ez.no/doc/ez_publish/technical_manual/4_x/concepts_and_basics/content_management/sections
<strong>DEFAULTS</strong>
Design 5
Media 3
Restricted 6
Setup 4
Standard 1
Users 2
3. Next, update the "Roles and Policies" which is located under Setup - Sections or navigate to... <b>ezpublish_dir</b>/index.php?/<b>super</b>/role/list On this page we will see a list of our default user roles...
Administrator
Anonymous
Editor
Member
Partner
Click the PENCIL icon to edit Anonymous 4. After click the pencil, you will see the Anony role's current policies. It will look something like this...
content read Section( Restricted )
content pdf Section( Restricted )
rss feed No limitations
user login SiteAccess( models )
user login SiteAccess( eng )
content read Class( Flash , Image , Quicktime , Windows media , Real video , Banner ) , Section( Media )
The most important value is "content --- read." This pertains to most all content that's not a pdf, rss, login area, etc...basically all of your articles. Make sure this area is restricted. If it's already restricted, click OK.
5. This now takes you to a page where you will see the exact same thing we saw in step 4 but at the very bottom, we also have a list of ROLES/PRIORITIES that are excluded from any restrictions. <b>ezpublish_dir</b>/index.php?/<b>super</b>/role/view/1 It should look something like this...
User group Members No limitations
User group Partners No limitations
User group Anonymous No limitations
6a. <b>NO ANONYMOUS BROWSING - FORCE LOGIN/REGISTRATION</b> To keep Anony users from viewing any areas without logging in BUT at the same time allow them to view all of the top level links of your site, DELETE the Anony usergroup. Now, when a non-logged in user goes to your site, they will see the links and upon clicking on them, they will be taken to the standard error page with the following message and the login form...
You do not have permission to access this area.
Possible reasons for this are:
* You are currently not logged in to the site, to get proper access create a new user or login with an existing user.
* You misspelled some parts of your URL, try changing it.
6b. <b>PARTIAL ANONYMOUS BROWSING - FORCE LOGIN/REGISTRATION</b> If you delete the anonymous role, don't worry, the system automatically recreates it any and every time you navigate through the Roles list. So simply going back to verify that your changes have taken place adds a new and undoes all of your changes UNLESS you delete the following (again)...
User group Anonymous No limitations
- So to allow the Anony user to view some areas of the site, but not all of them, we're going to go back to step 3 and proceed to step 6a BUT this time we're going to click the PLUS icon, not the PENCIL. That takes us here... <b>ezpublish_dir</b>/index.php?/<b>super</b>/content/browse - On this page, put a check next to Anonymous then press the Select button. That takes us here... <b>ezpublish_dir</b>/index.php?/<b>super</b>/role/view/1 - Once we're here, we now see the same things we saw in step 5 (above). Now that...
User group Anonymous No limitations
is back, we're going to ADD the pages that we want the Anonymous visitor to see. I was thinking it was the reverse, that you add the pages you want to restrict. NO, you'll be adding the pages that you want the Anony user to have access to. - Put a check next to Anonymous User - Now select Subtree from the drop down menu. - Click Assign with Limitation - Select the radio button next to the area you want the anony user to see. For example purposes, say that we want to grant access to the "GOOBER" subtree. - Press Select - Check Anonymous User - Press Select
- We're now back on the following page... <b>ezpublish_dir</b>/index.php?/<b>super</b>/role/view/1 At the bottom, we see...
User group Members No limitations
User group Partners No limitations
User group Anonymous Users No limitations
User group Anonymous Users Subtree: "GOOBER" (/1/2/77/)
- DELETE / Remove Selected ----- User group Anonymous Users No limitations Now we have this...
User group Members No limitations
User group Partners No limitations
User group Anonymous Users Subtree: "GOOBER" (/1/2/77/)
- Clear your cache and navigate to the front end of the site. - Make sure you're not logged in. Now you should only see a link to GOOBER. All other links on your site are not visible. You can add more subtrees as necessary so that the user can view certain areas and not others.
Aang: Just like the legend says, we let love lead the way.
|