Bradgatewood,
No why build a new entershared scope when the one you have will work with a
little Yankee Enginuity?
Heres a tested (yes it works) you get it done before lunch solution and the
catalog controls work too! I guarantee you'll be the hero at work. Allow
some users to entersharedscope but depending on their role you enable
layoutchange only to certain webpartzones. You enable layout change to the
branch manager webpartzone for users in the branch manager role. You enable
layout change to the manager webpartzone for users in the manager role.
Hopefully your getting this. Helpdesk and a few higher up people get layout
change to all webpartzones.
When you switch to an editing mode disable layoutchange in all webpartzones.
Then selectivly enable layoutchange based on role in company. My test
didn't use roles because well I'm web master and can do stuff like that. but
you could substitute the isinroles method for the identity.name="dan" boolean
test I used.
Protected Sub btnAdmin_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnShared.Click
If _m.Personalization.CanEnterSharedScope Then
_m.Personalization.ToggleScope()
End If
End Sub
'my enter edit mode button
Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles btnEdit.Click
entermode(WebPartManager.EditDisplayMode)
End Sub
#Region "WebpartHelpers"
'Code to toggle a webpart displaymode between browse/mode
Private Sub entermode(ByVal mode As WebParts.WebPartDisplayMode)
'the IsEnabled function of webpartmanager checks the page
'and the current page users authority to enter a mode.
'If there is no editorzone on a page the page cannot enter edit mode.
'if the current user has deny verbs="modifyState"
'the current user can not enter editmode.
dim _m as webpartmanager = webpartmanger.getcurrentwebpartmanager(page)
If _m.DisplayMode.Name <> mode.Name _
And _m.DisplayModes.Item(mode.Name).IsEnabled(_m) Then
_m.DisplayMode = mode
Else
_m.DisplayMode = WebPartManager.BrowseDisplayMode
End If
'testing code for Ryan and limited sharedstate starts here
'nine lines of code demo.
If _m.DisplayMode.AllowPageDesign Then
For Each z As WebPartZone In _m.Zones
z.AllowLayoutChange = False
Next
If Page.User.Identity.Name = "dan" Then
_m.Zones("F").AllowLayoutChange = True
_m.Zones("Z1").AllowLayoutChange = True
End If
End If
End Sub
#End Region
Good Luck
DWS
PS I'm going to incorporate this into my web site. So I can give some users
limited ability to do shared personalization on the site thanks for the idea.
Check out my webparts at
www.dws400.com, Brand New real time javascript
appearance editor I just made it last week. register and give it a whirl.
Click the tree after you log in to enter edit mode.
"br**********@insightbb.com" wrote:
I am in the process of developing a highly customizable application and
I'm looking for a way to allow personalization by role. This is
different than shared scope in the fact that I want to allow multiple
clients to make modifications to properties, placement, controls on
page, etc... and have all users see the customizations that apply to
them. Customizations will take place at Client > Branch > Division
levels. So when a user logs into the application I will retrieve keys
for each level (ClientKey, BranchKey, DivisionKey) and based on those
keys I will determine which customizations they see.
I'm thinking to pull this off I will need to create a custom
PersonalizationProvider and a custom WebPartPersonalization class to
store the information in a slightly modified schema.
thoughts?