473,545 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Personalization Provider and a custom WebPartPersonal ization class to
store the information in a slightly modified schema.

thoughts?

Mar 30 '06 #1
2 3137
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 entersharedscop e 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.EventArg s) Handles btnShared.Click
If _m.Personalizat ion.CanEnterSha redScope Then
_m.Personalizat ion.ToggleScope ()
End If
End Sub

'my enter edit mode button
Protected Sub btnEdit_Click(B yVal sender As Object, ByVal e As
System.Web.UI.I mageClickEventA rgs) Handles btnEdit.Click
entermode(WebPa rtManager.EditD isplayMode)
End Sub

#Region "WebpartHelpers "
'Code to toggle a webpart displaymode between browse/mode
Private Sub entermode(ByVal mode As WebParts.WebPar tDisplayMode)
'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="modifySt ate"
'the current user can not enter editmode.
dim _m as webpartmanager = webpartmanger.g etcurrentwebpar tmanager(page)
If _m.DisplayMode. Name <> mode.Name _
And _m.DisplayModes .Item(mode.Name ).IsEnabled(_m) Then
_m.DisplayMode = mode
Else
_m.DisplayMode = WebPartManager. BrowseDisplayMo de
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.AllowLayoutCh ange = False
Next
If Page.User.Ident ity.Name = "dan" Then
_m.Zones("F").A llowLayoutChang e = True
_m.Zones("Z1"). AllowLayoutChan ge = 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**********@i nsightbb.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
Personalization Provider and a custom WebPartPersonal ization 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
2334
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 concern. I have described the situation below because we are very curious to see what other, more experienced, developers might suggest. The specific...
2
3032
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 content based on the user's role. I wrote this to do it: if (HttpContext.Current.User.Identity.IsAuthenticated) { plLoggedIn.Visible = true;
0
1159
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, the rest of my site ties very intimately into my users. I have many tables (such as News, PhotoGallery, ForumPost) which have a UserID column. From...
7
2991
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 are ASP and ASP.NET. This security design must support *both* technologies. Currently, we have a successful collection of both ASP and ASP.NET...
1
1649
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 store this phone number. Is it possible to query personalization data so I will be able to retrieve the phone number of each user?
2
1784
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 any SQL Express or any SQL server for that matter. how do i disable the entire personalization of my application. i tried: <webParts >...
1
1294
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 create database tables that have an entry for each user and the features they have access to. The logic that decides whether the feature should be...
0
1059
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 his group. 2, to a 'personalization' of a whole page. my solution to the first problem is: Add a new class inherits the webpart class and...
2
1064
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 enter time actually have entered it for each week... sooo..... how would you suggest I track who enters time? Should I just create a role, named...
0
7669
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7926
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.