Sign In  |  Register
 
 
DotNetNuke Support Forums
Creating restricted Admin and Content Roles
Last Post 13 Nov 2007 10:47 AM by Tigris. 13 Replies.
Printer Friendly
Sort:
PrevPrevNextNext
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
eclayf
New Member
New Member
Send Private Message
Posts:19

--
05 Sep 2007 03:12 AM  

Hi John,

You have been so helpful in these forums I thought I would give back a bit on the issue of creating a "content management" role for DNN.  This is an issue I have read so many posts on in the DNN forums and searched for a solution for that I was amazed it was so simple to solve.  So, I thought I'd post my solution here. I decided to experiment with the admin.template, as that is the file DNN uses to create the Admin menu in a site.  All I did was to create a new "tab" in the template (named Content) to use as "parent" tabs for the new restricted role which I called "Content" as well.  Then I cloned in the tabs and modules from the existing Admin page so they would appear under the newly created tab.  Then I added the tab permissions so "Content" would have access to that tab and it's associated tabs and modules. 

Then I pasted in in above the existing "Admin" tab with all of it's existing tabs, modules and permission settings so it would appear before the Admin tab.  I did not give any "page edit" permissions to the new Content Role, so it only had access to modify existing tabs and renaming them, but not to adding new tabs as I did not want this new role to be able to add, only to edit. 

 

Next, I eliminated several other tabs and their modules (such as Site Log and Log Viewer, Authentication, etc.) from the "Admin" menu settings to further restrict the Admin role and changed the "Admin" to "Site Manager" to create a new Site Manager role and tabs.  I left in User Accounts, Email and a few others for the Site Mnager and also gave this role access to create new pages, not just rename and manage them.  Then I pasted back in the normal Admin template to re-create the normal Admin role.

This does not address the Control Panel Issues, but you can buy a Control Panel Manager from someone that will allow you to deny access to the Control Panel completely, or partially and even further restrict the admin roles you just created.  I used the Custom Control Panel replacement from ArrowNuke.  It only cost $14.95 after all and allowed me to set a default for all portals so that when setting up new sites, the restricted roles work wonderfully.

What you end up with is THREE administrator tabs.  One handles normal stuff for a content role, one most of the normal stuff for a "Site Manager" and lastly, the standard Admin role.  The Content role sees only Content stuff, the Site Manager sees the Content tabs and also it's Tab, but not any Admin stuff.  The Admin role sees them all.
Make sure in your Site Template that you have a Content role and a Site Manager role so they can be accessed, or you will have to manually create those afterward.  You also need to keep a copy of your finalized admin template in case you upgrade DNN later and it gets replaced.
I have pasted in the admin.template file below for anyone who wants to play with it.  You will need to paste it into your admin.template file to make the changes.  I'm sure I got this version totally corrected, as it is working on my site, but use it at your own risk!!!

 

Clay


Attachment: admin.template.zip

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4384
Avatar

--
07 Sep 2007 12:33 PM  
Thanks for sharing this Clay.


cgrill
New Member
New Member
Send Private Message
Posts:5

--
08 Oct 2007 03:18 PM  

Clay, this is exactly what I've been looking for but I'm having some trouble getting this to work. When I follow your directions, I get the new navigation tabs to show when logged in as a host, but they don't show for admins or the newly created roles (e.g. Content). Could this possibly be an issue DNN 4.6.2? If anyone has any addditional advice to offer, it would be a lifesaver.

thanks!  Chris



eclayf
New Member
New Member
Send Private Message
Posts:19

--
08 Oct 2007 05:26 PM  

Hi Chris,

Be sure that those roles exist in the site template of the site you are creating.  The menus will be deployed because they are in admin.template, but it there is no corresponding role in the site template used to create the site, then you would have what you are explaining.

Also, if you want to, you can simply edit the new admin.template and grant "view" rights to the "Administrators" role for each menu and menu item, and "edit" rights if you want to.  Then when the site generates the Admin role will have the ability to view those menus.

The way I did this one was to create a division between the Admin, the Content and the Site Manager roles.

In my latest version, I eliminated the Content menu/role to simplify things.  Found I didn't really need that level of granularity.

Here is a copy of that one.

Clay


Attachment: NewRestrictedAdminTemplate.zip

cgrill
New Member
New Member
Send Private Message
Posts:5

--
09 Oct 2007 08:42 AM  

Outstanding...that did the trick.

Is there a way to add a restricted admin retroactively to an existing site that doesn't already have it? I was poking around in the db hoping for a few easy edits but the tables are pretty intertwined and I'm having trouble piecing together what is needed.

thanks!  Chris



eclayf
New Member
New Member
Send Private Message
Posts:19

--
09 Oct 2007 02:15 PM  

There is a way to do it, but you'd have to know SQL pretty well and how to create a page programaticly.  If you research the DNN forums I know I have seen some posts recently on creating pages programaticly.  Or, you could ask John here, he would probably know a simple SQL statement that would do it.

The "Hard way" would be to export the site to a new site template, (including all content) then recreate it with the new admin.template in place.  You would have to know for sure that ALL the modules in use on your site are capable of the export AND the import process or you would loose some data and cause problems.

Best way is to find that SQL Statement, the look up the values in the tables that need to be set to make them children of the Site Manager page, etc.

Glad it worked for you.  It sure has been a life saver for me.

Clay



cgrill
New Member
New Member
Send Private Message
Posts:5

--
09 Oct 2007 02:24 PM  
Thanks for your speedy input. The legacy sites are probably going to have to do without for now. I actually did get it working but I don't have a lot of confidence in the many db changes that I made. I'm no db expert.

But for future sites made from scratch, your admin.template file works perfectly. thanks again, Clay.

Chris


Tigris
New Member
New Member
Send Private Message
Posts:24

--
02 Nov 2007 11:15 AM  

Hi Clay,

 

Thanks for the insight. I am a bit befuddled and wonder if you could spare time to help me with this.

 

I downloaded a copy of your latest file and just for testing, I backed up my original admin.template and then overwrote it with your new one.

Then I went to the dnn.template file in the same folder, added in this code:

   
      Site Manager
      Site Manager
     
      -3.40282347E+38
     
      -1
      -1
      -3.40282347E+38
      false
      false
     
     
      adminrole
   

and saved it. When I log in as host, I don't see anything different... no additional menu items or anything. Then I tried creating a new role named 'Site Manager' and added the host account to it, but still nothing. Any suggestions?



Tigris
New Member
New Member
Send Private Message
Posts:24

--
02 Nov 2007 02:51 PM  

Can anyone help?

 



Tigris
New Member
New Member
Send Private Message
Posts:24

--
02 Nov 2007 03:02 PM  

Is this something that has to be done before installation of the portal or can it be performed successfully after the portal exists?



Tigris
New Member
New Member
Send Private Message
Posts:24

--
02 Nov 2007 04:02 PM  

Never mind...I see now that this is most useful for portals that are about to be created.



eclayf
New Member
New Member
Send Private Message
Posts:19

--
11 Nov 2007 04:39 PM  

Sorry I didn't see this earlier Tigris.  You could create a single page site, using the new template, export that single page site as a template itself, then, using the site wizard, upgrade or "change" the old site to the new template, remembering to include all the content in the transfer.

This might have issues with any third party modules that don't support exporting of the data, but otherwise it should work and solve your problem. 

This will not work in an exisitng site, simply by changing the template, you must run the process for the new role to be created, using the new site wizard, or the site wizard in the control panel to access the "one page" site template I just described.

Clay



Tigris
New Member
New Member
Send Private Message
Posts:24

--
13 Nov 2007 10:47 AM  

Sorry for my ignorance but I am unsure about how to 'create a single page site, using the new template, export that single page site as a template itself'

Do you mean a single page DNN site? If so, that is what is created when one first creates a DNN site, correct?

Or do you mean just a plain ole' .NET site, based on a template? If so, how does one do that?

Finally, how does one 'export that single page as a template?

 



Tigris
New Member
New Member
Send Private Message
Posts:24

--
13 Nov 2007 10:47 AM  

I am also exploring another venue to achieve the goal of allowing newly created custom admin roles to view some modules that typically only a portal admin or host would have access to.

What I have done is create a new folder in DesktopModules called SiteManager_Users and copied the contents of ~/admin/users into it.

Then I create a new module and point it to  SiteManager_Users\users.ascx

Then I create a new page and add the module. The initial users control appears in this new page but once a specific user is found and the edit button is selected, poof, nothing apears anymore.

If I was able to make this work, then I could grant permission  to this page as I please.

I am currently exploring methods to make this work, any suggestions on how to display the subsequent controls for users.ascx (EditProfileDefinitions.ascx for instance)



Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.


Active Forums 4.1
Visit our Store for great DotNetNuke Modules and Skins
DotNetNuke CSS Menu 3.4.6 (single use)

Item codeCSSNM33SU
AuthorJohn Mitchell
Base Price$39.00
Product Information 
DotNetNuke CSS NavMenu 3.4.6 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
DotNetNuke Performance Caching & Compression - PageBlaster 3.4.5 - Professional Edition

AuthorJohn Mitchell
Base Price$59.00
Product Information