You need to Register for free and Login to post a message in the forum.

Forum

Subject: Limit access to all pages for "all users" at one time with SQL or other way
Prev Next
You are not authorized to post a reply.

Author Messages
datamark
DNN Creative Magazine Subscriber

Posts:10

05 Jun 2008 9:30 AM  
Hi everyone and Lee,

I opened with interest issue Issue 33 - Professional DotNetNuke Administration using SQL (Part 2) and learned a lot. Your videos are the best!

Very much related to the issue, I want to remove the "view" access for the "All Users" role to all the pages. I think it would be great to use a SQL query to do the work, but I cannot find a role or user or anything named "All Users" in the tables.

The purpose of doing this is, this site is not rolled out yet and is underdevelopment even though there are 20 authors and 40 pages. We don't want the rest of the world to see the site yet. (They can now).

1. do you know which role or user or whatever to change the view permission for for all unregistered users?

or

2. is there an easier way to lock out the general public from seing the site when all the pages already have view permissions assigend to the "All Users" role?

Thanks Lee and everyone for your help in the forums!
leesykes
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3112

06 Jun 2008 2:51 AM  
Hello,

Glad it was useful!

ok, lets go through this step by step as it is slightly complicated

Go to your DNN database tables
View content of:

TabPermission - This holds the security permissions for the page

we now need to work out what the columns mean:

open

Permission - Here you can view the PermissionID and the PermissionCode
In the TabPermission table we can see they use PermissionIDs 3+4, if we look in the Permission table we can see ID3 = SYSTEM_TAB (View Tab) (so this is the view tick box column in the page settings) and ID4 = SYSTEM_TAB (Edit Tab) (so this is the edit tick box column)

View TabPermission table
View the data from one of your tabs - I'm going to look at TabID 56
I have 3 rows of data,
permission ID = 3 + Role ID = 0
permission ID = 4 + Role ID = 0
permission ID = 3 + Role ID = -1

Lets now look at RoleIDs to see what they mean

Open Roles table
first row, RoleID 0 = Administrators

So we can assume at this stage that RoleID = -1 is the 'all users' setting

BACKUP EVERYTHING

Login as Host to your DNN install
Go to Tabid 56
Go to page settings
Here we can see view page and edit page are ticked for administrators and View page is also ticked for all Users.

Go back to  TabPermission table, click on the row  with
Tab ID = 56, permission ID = 3, Role ID = -1
Press Delete to delete the row

Now go back to dnn / host menu - restart application

View page settings of TabID56 and you will see only admin have permissions and the 'all users' tick box is now unticked.

So, all we have to do now is create a query for that!

Rather than delete the RoleID I would suggest that we change it to a different security role, so when you want to re-enable the permissions to 'all users' you can just apply it to those roles with the new security role.

- Login to DNN - create a security role
I created one named 'limit access' - Go to the Roles table and view its ID, the Role ID = 4 for mine

Now go back to TabPermission table
We now want to change any rows that have RoleID=-1 to RoleID=4

So:

UPDATE TabPermission
    SET RoleID = 4
    WHERE RoleID = -1


View the TabPermssion table, you can see the results have worked correctly

Restart the DNN application
View page settings for tab ID 56

You will see 'All Users' is unticked and 'limit access' is now ticked

All you have to do now to flip it back when you release is:

UPDATE TabPermission
    SET RoleID = -1
    WHERE RoleID = 4



So, it takes a bit of working out, but the end query is very simple to implement and think of how many hours of work you have just saved resetting all the permissions! - SQL is very cool!

Cheers,

Lee



Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts
You are not authorized to post a reply.
Forums > Users Lounge > DNN Creative Articles > Limit access to all pages for "all users" at one time with SQL or other way



ActiveForums 3.7

Latest Forum Posts

News&Articles Module by gabrieleseven
Hello, I've created a Portal for news and info about the world of music. I need a module that allow ...
RE: Install DNN.4 on Win 2003 and SQL2000 by jncraig
1. Add a portalalias for your new site's URL before you do anything. 2. Make a backup of your dat...
RE: Custom Module Development by jncraig
I would recommend adefwebserver.com for good information on writing modules. Without looking over...
RE: Dynamic page navigation by jncraig
I take it that you have developed 10 separate pages? Are these pages with a custom module or with c...
RE: Pop up window by jncraig
I believe that ZLDNN (zldnn.com) has a module that will pop up a page or a module. I've not tried i...
Dynamic page navigation by coder247
Hi all,          We are developing a web app using DNN and we've a requirement like this. There are ...
Custom Module Development by neenu
I created my own module using DAL,by adding 4 class files in app_code directory, say alistinfo.vb,al...
Pop up window by yerann
Whenever a page loads in DNN i would like a pop up window to display.  This pop window ask the user ...
RE: Customise registration page by nichord
Thanks Rob... I would have never found this one on my own.And many thanks to you Lee... My print com...
Install DNN.4 on Win 2003 and SQL2000 by amine97
Hi all,I will be working on creating a website on my development server Windows 2003 and SQL Server ...
RE: Dynamically Add modules by jncraig
You can include a module on multiple pages within a portal by selecting "add existing module" on the...
music player, music charts by mrvorazan
hey,i havev to create a music portal, so i need a module to upload music files by users, they have t...
Dynamically Add modules by UmaRam
Hi, Please advice how to add an existing module in a page to another page in the same portal and ...
Dynamically add module by UmaRam
Hi, Please advice how to add an existing module in a page to another page in the same portal and ...
RE: VWD 2008 & SQL Express 2008? by rc_kemal
It is very difficult to convert the database from sql2008 express to sql2005 express. To answer my o...
RE: User Registration Questions by jncraig
I would recommend that you NOT begin your DotNetNuke life by starting to modify any of the code. Ye...
RE: Dotted Lines Around Navigation by HUGHD37IUOE
Here it is: http://www.iuoe.org
RE: Installing on XP Home by nexduke
Hi Yes, I'm using SQL Server Express 2005, what would you suggest I do if it is a configuaration ...
RE: Exporting and transferring Modules. by ollep
Thanks Lee! Yes I will check out the Forum – and the hosts before I sign up.   I expect to see an...
User Registration Questions by stevennestler
Hi.I'm new to DNN, and just watched my first set of videos on this site, for customizing registratio...
DotNetNuke Modules
RSS Feeds