3

I have a DNN site that I now want to change so that users must log in beofre they can view any of the content. I can go to each page an change the permissions but i am looking for a faster way - even if that means going into the database.

4 Answers 4

3

This will remove all of the "Unauthorized Users" permissions from all of the pages on a portal:

DELETE
FROM TabPermission
WHERE RoleID = -3 -- Unauthorized Users
AND TabID IN (
    SELECT TabID
    FROM Tabs
    WHERE PortalID = YOUR_PORTALID_HERE
)

Then replace all of the "All Users" permissions with "Registered Users":

UPDATE TabPermission
SET RoleID = -2 -- Registered Users
WHERE RoleID = -1 -- All Users
AND TabID IN (
    SELECT TabID
    FROM Tabs
    WHERE PortalID = YOUR_PORTALID_HERE
)

After you run this, go to Host -> Host Settings and under the Performance section hit "Clear Cache".

You could run a similar statement against the ModulePermission table but it shouldn't be necessary if you're locking down all of your pages since if they can't view any pages they won't be able to view any modules.

Not responsible if any of this destroys your database, injures your pets, etc. Make sure to backup your database before running the script!

2

The fastest, non-technical method is to go to the parent pages on the portal, change the permissions to suit you, then copy those permissions to the child pages. If you have tons of parent pages, go to Admin>Pages and group all parent pages under one parent page... change the parent permissions and copy to all child pages, then reinstate your page hierarchy.

0

The fastest way would be to write an update statement against the TabPermission table. Most likely you would change all of the -2 or -1 (depending on DNN version) values to something like Registered Users.

Use caution, backup your database, and test it before you actually do it in production. I can't stress that enough.

You'll want to look at the ModulePermissions table as well.

-1

You can just use IIS authorisation to do it, if you wish, but it doesn't provide "registration".

http://msdn.microsoft.com/en-us/library/aa292114%28VS.71%29.aspx

2
  • DotNetNuke has its own registration and permission system. Jan 21, 2010 at 0:50
  • Lance: Yes, obviously, but you'll note that's not what he asked.
    – Noon Silk
    Jan 21, 2010 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.