How to set permissions on SharePoint to hide an aspx page for authenticated users and to make it visible for anonymous users
I have a portal based on a publishing portal. The portal (SPSite) contains has two websites (SPWebs) one is ano开发者_运维百科nymously 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?
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.
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.
精彩评论