Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dynamic rolesDynamic roles
Previous
 
Next
New Post
10/18/2006 3:44 PM
 

Hi all,

Please bear with me, I'm relatively new here and will likely misuse some of the native DNN terminology...

Can anyone tell me if there is are hooks (or a module?) in DNN that will allow to calculate authorization or roles? This would be to allow, for example, edit privileges to a module depending on the content.

Maybe an example best describes it. Let's say I have a DNN site that represents a school. I will have 2 roles: teachers and students. I will have a module that shows class information (such as homework assigments) for any given class. Lets say a parent list of classes with a child list of homework assignments. 

I want any role (teacher or student) to be able to view both lists, but only the teacher of a given class to have Edit authorization for their own class(es). Teachers should have view-only rights to any class that isn't their own.

If I use standard role authorization, then any teacher could edit any other teacher's homework list, and whence my original question derives.

Thanks,

 

Wayne

 
New Post
10/18/2006 7:13 PM
 

Not a problem.

All you need to do is take your edit logic one step further.  When you select edit, if you also look at UserID, you can be user each teacher is only editing their own "view".

 

 
New Post
10/18/2006 8:16 PM
 

Here's where I can really show how little I know...

I was expecting it was as you describe it, but I was hoping for something a bit more specific in terms of DNN. From what I've read, when you configure a module, you assign roles, and the resulting built-in behavior doesn't do what I need. The other extreme is as you say, look at the UserId and make sure the teacher is editing their own view.

My question is though, are there DNN standard hooks or callbacks for this kind of custom authentication/authorization, or do I have to custom code this logic into any module in which requires this behavior. The latter I'm sure I can do, but I was trying to keep the proper "modular" approach to it if I could, and do it in a proper DNN fashion.

Thanks,

Wayne

 
New Post
10/19/2006 8:51 AM
 

So far as the "proper DNN fashion" as long as you are doing module development by following the developer's guide, you're pretty safe.  The functionality of the module is really up to you.  That said, you still have a few options that aren't as extreme as solely using userid.

You eluded that this is for a school.  Is it a single school or a district?  The reason I ask is more from a practicallity stand point.  The three options I see for you are:

  1. Use a dropdownlist or querystring to identify which teach you are viewing/editing
  2. Use settings to identify the teacher and base edit privs on userid
  3. Use settings to identify the teacher and base edit privs on roles

Options 2 & 3 require you to have one page per teacher.  Depending on how you planned to organize the site, this may or may not be appropriate.  Option 3 uses a more traditional DNN approach; edit privs are based on a role that can edit that module.  A role is simply a logical grouping of users.  There's no rule that says you have to have more than one user in a role.  This may not be practical if you have 1000s of teachers (eg: school district).  If you only have 50-100 teachers, though, this is an easy way to do what you want.

For Example:

Ms Brown teaches 3rd grade and Mr Hall teaches 4th grade.

  • Create a priv group for Ms Brown (Ms Brown Teacher) and another for Mr Hall (Mr Hall Teacher).
  • Create a priv group for Ms Brown's students (Ms Brown Students) and another for Mr Hall's students (Mr Hall Students)
  • Create a tab for 3rd grade and a page for each 3rd grade teacher (of which Ms Brown is one)
  • Create a tab for 4th grade and a page for each 4th grade teacher (of which Mr Hall is one)
  • On Ms Brown's page set view privs to her students role and edit privs to her teacher role (remember, she's the only teacher in her role)
  • On Mr Hall's page set view privs to his students role and edit privs to his teacher role.

Now when Ms Brown's students navigate to 3rd Grade --> Ms Brown, they will see her page which she has control to edit.  Mr Hall's page works the same way.  In this scenario we are not allowing students outside that class to see another class' page.  This may be more stringent than you need, but it's an option that's easy to implement.  Keep in mind a user can be in more than one role so students may have access to multiple teacher pages, but only the single teacher can edit their own page/module.

The important thing about module design in this scenario is to remember to include moduleid in your table.  This will allow you to have multiple instances of the module throughout the portal.



 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dynamic rolesDynamic roles


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out