Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

How to use membership classes with multiple 'projects'...?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Glenn - 07 Sep 2007 16:59 GMT
My current classic-ASP site has users, projects, roles and the 2.0
membership looks like a perfect fit, but I'm having trouble finding
examples of how to have users that belong to different projects, and
have different roles per project.

The current model..

* When a user joins my site, they eventually end up joining or
creating one or more projects.  But, they are not required to be a
member of a project to be a member of the site.

* As a member of the site, a user can be a member of zero or more
projects.

* They can create a project, for which they automatically assume a
'project owner' role.

* They can also join an existing project, in which they assume the
'regular member' role by default.

* So, a project will always have a member with the 'project owner'
role, zero or more with either the 'project lead' role, and zero or
more with the 'regular member' role.

* Users can leave a project at any time, unless they are the project
owner, in which case they must transfer ownership to another project
member.

* A common 'view' for a user is to view information across the
projects of which he is a member.

Currently, I have over 20,000 users, each with a unique user id (int),
and 500+ projects, each with a unique project id (int).  A simple join
table associates users with projects (table:'user_projects': columns:
user_id,project_id,role,etc.)

Can I adapt the ASP.NET 2.0 membership classes to this model?  After
looking for a while, I don't think an 'application' as defined by the
membership classes correlates to a 'project' in this case.  I think my
projects need to be more dynamic.

Any tips, pointers, examples would be appreciated.

Thanks,
Glenn
Just Me - 07 Sep 2007 22:11 GMT
You can write your own membership provider to fit in with the existing 2.0
set of classes although its not something ive bothered to do.

Generally, I tend to "Roll my own" membership classes as I find it gives me
most flexibility. The set of standard classes supplied with .net are really
there as starter blocks if you like but if you need to get more serious,
then either write your own provider or simply write your own code to handle
membership and roles, It sounds like youve already done it in the backend
for ASP anyway, so a simple port to the new environment is all you probably
need to do.

> My current classic-ASP site has users, projects, roles and the 2.0
> membership looks like a perfect fit, but I'm having trouble finding
[quoted text clipped - 41 lines]
> Thanks,
> Glenn
clintonG - 08 Sep 2007 01:27 GMT
I think Membership and Roles --as is-- would work just fine with a
role-based schema analagous to an alphanumeric part numbering schema so
widely used to assign "membership" and "role" categories to products, parts,
assemblies and so on.

// conceptual alphanumeric example of a "set"
G000   -- G(uest) with default access to all projects.
P000   -- P(roject) Creator

Make the alphanumeric identifier with several sets to account for future
extensibility...
G000-000-000
P000-000-000

Use alphanumeric or numeric characters in the sets to designate access
rights, project types and so on.

G001-000-000 - Guest with access to Project Type 1 where 1 may represent all
read, write, edit rights or some other designation but not the right to
delete the project and so on.

Instead of writing all the provider code you just write your own
authenication class which assigns and modifies user's roles when they
create, join or leave projects which should also be categorized by type and
indicated alphanumerically in one or more of the sets of indentifiers.

I had to so some of this for some e-commerce applications when using ASP. It
takes a lot of thinking and planning but IMO Membership and Roles --and--  
Profiles are already setup for what can be complex membership models.

<%= Clinton Gallagher
        NET csgallagher AT metromilwaukee.com
        URL http://clintongallagher.metromilwaukee.com/

> You can write your own membership provider to fit in with the existing 2.0
> set of classes although its not something ive bothered to do.
[quoted text clipped - 52 lines]
>> Thanks,
>> Glenn
Just Me - 08 Sep 2007 10:52 GMT
mmm, well ok. But I think this fixed numbering is restrictive. better to use
relational tables with almost unlimited expansion. The way I normally do it,
is to have non hierarchical role types,  so a user can have many roles
assigned to them, which do not directly depend on each other other than in
the business logic. Permissions are dependent on the object one is
accessing, again, your system can then have a table of object types with a
set of permission types associated with them. and these can be stored in a
permissions table associated with the user and objects.

ON top of this is you really want to get clever you can add groups as well,
but then you enter the arena of group manegment, and groups in themselves
like users are just another object. Where it gets really hairy is when the
groups are inclusive and exclusive as well as being nested.

Your statement about carefull thought is probably the most poignient one,
when designing such a system, one needs to keep a few things in mind.

1.) Make sure you did a good systems analysis job first.
2.) Think carefully , very carefully.
3.) Make sure its workable, and signed up to by the client, as changes
afterwards can be a nightmare.
4.) Keep flexibility in mind, but beware of  over complex design.

Hope that helps.

>I think Membership and Roles --as is-- would work just fine with a
>role-based schema analagous to an alphanumeric part numbering schema so
[quoted text clipped - 87 lines]
>>> Thanks,
>>> Glenn

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.