Teun.ToString()

by Teun Duynstee [Macaw]

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Subscriptions

News

I discontinued this blog. I now post at: www.TeunToString.net



Download Finch PocketBlogger

Post Categories

Article Categories



Thursday, February 10, 2005 - Posts

How to prevent certain users from switching to shared scope (ASP.NET 2.0 Webparts)

In reaction on my posting on the UnpersonalizedZone class, someone asked me by personal e-mail how to prevent certain users access from the shared scope. This is indeed necessary information for the UnpersonalizedZone to be useful.

The access to the shared scope is enabled through web.config. It hooks into the new role management application that comes standard with ASP.NET 2.0. Through this application, you can create users and roles and assign users to roles. Using the provider model, you can use a storage backend of your choice (a database, an XML file ActiveDirectory, you name it...).

In web.config, you can specify which users and roles can switch from the Private to the Shared scope.

<webParts>
  <personalization >
    <authorization>
      <allow roles="superusers" verbs="enterSharedScope" />
      <deny users="*" verbs="enterSharedScope" />
    </authorization>
  </personalization>
</webParts>

This will allow only the users in the role superusers to switch to the shared scope. All other users are denied this privilege. Also, the users and roles attributes can contain multiple users and roles.

PS. The only two verbs that I am aware of are enterSharedScope (to view the page in it's unpersonalized form) and modifyState (to be allowed to switch to any mode but Browse).

posted Thursday, February 10, 2005 11:28 AM by TeunD with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems