473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Role Based Personalization

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?

Mar 30 '06 #1
2 3120
DWS
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?

Mar 31 '06 #2
Thanks for the feedback.
I took a look at shared scope but my understanding of it is that when
you make a change shared it applies to all users. One of my
requirements was that a user only sees changes that are within their
client, branch or division. Let me elaborate.

1) User enters username and password
2) Determine users role and retrieve user information
3) Based on which client, role, division retrieve site customization
for URL
4) Apply custom look and feel, web part layout, etc...

Each user will be in a role which then defines their place in the
hierarchy. At each node the page could have different color schemes,
text, fonts, images, etc... based on the theme applied and based on the
customizations applied they could be displayed different web parts,
have permission levels effected, etc..

So really I need a solution that instead of using the ASPNET
personalization schema and rendering customizations by user(s) I can
specify which personalization to apply. So I would have my own
structure for storing customizations and would want to retrieve them
based on who logged in.

Example:
Key | ClientKey | BranchKey | DivKey | URL | PageSettings
1 1234 123 12 2.aspx data
2 1234 121 12 2.aspx data
3 1634 125 11 2.aspx data

So for user "Brad" I want to use Customization #1 but for user
"Gatewood" I want #3

Mar 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: craig | last post by:
I am working on my first .NET development project that involves custom role-based security per the project requirements. This lead to a general design issue this week that really caused us some...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
0
by: Danny Tuppeny | last post by:
Hi all, I'm after some advice... I'm building a website which will have a login etc.. The Personalization in asp.net 2 stuff looks like it'll save me some time (login controls etc.), however,...
7
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with...
1
by: Ya Ya | last post by:
I am using the personalization feature in asp.net 2.0 I am storing the phone number for each user. When a certain user enters his phone number I would like to check if another user already...
2
by: Roger23 | last post by:
I have a requirement where I need to remove or disable the entire personalization feature of my web application. I am not allowed to have a SQL express on my web server and I am not allowed to have...
1
by: JohnC | last post by:
I'm in the concept stage of putting together a web application. Certain featues will be available only if the person has been given access. This is based on their particular subscription. I can...
0
by: Bei | last post by:
Now I'm facing a requirement that every users can personalize their own web parts, and there is a administrator who has rights 1, to publish a 'personalization' of a single web part to all users in...
2
by: Larry Bud | last post by:
We have a time and project tracking system. In short, only certain users will be entering time, while everyone has access to the project listing side of things. I need to make sure those who...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.