views:

123

answers:

2

I have a portal based on a publishing portal. The portal (SPSite) contains has two websites (SPWebs) one is anonymously accessible and other one isn't. This works as expected.

Now I want to set the permissions for some aspx page of the anonymously accessible website so that they are not visible for authenticated users. So it's actually the opposite of anonymous access. User that are not logged in should see the aspx pages and logged in user shouldn't. The aspx pages are normal publishing pages of the publishing portal.

How could I archive this. Is this possible at all?

A: 

If you configure SP to allow anonymous access to a page, it will let logged-in users see it.

To achieve what you want, you need to write some code. So, derive a class from PublishingPage and add the necessary check. Then, have a page layout that uses this new class.

Timores
I've already had the same idea, the problem is that the navigation won't be security trimmed.
Flo
Correct. You need to subclass the sitemap providers in order to take care of this.
Timores
A: 

Hi.

Although I haven't tried it myself (yet), this should be doable using the Target Audience feature.
Put these pages in a separate list, enable Audience targeting on this list. Then you need to create a custom audience for anonymous users using this feature on codeplex.com

Hope this helps.

Magnus Johansson

related questions