Posts

Showing posts from 2010

Breaking Permissions and Web Part Access

Here is a tip about how to prevent your site owner or other users who have access to add web pages from getting an access denied message when they try to edit a page. Background You have a site collection with a top level site that you don't want anyone to access so you remove the permissions from it. Then on your sub-sites you break inheritance so you can get the security set up the way you want. The Issue When users go to edit a page to do something like add a web part they are given an access denied error. You can see this even if you have "Full Control" access on the sub-site. The Resolution Go to the top level site and create a new Group (ex: WebPartViewers), but don't give it any access. Next, add the users or groups that you want to be able to add and remove web parts from a page. You could add "Authenticated Users", but that is probably not a good idea since you will be opening up the web part library with this change. Now go to the Web Part Gall...

Backup and Restore with sitelock option

This is just a little FYI to save you some time. When you do a backup of your SharePoint site it is a good practice to use the stsadm command "setsitelock" so users aren't making changes that can corrupt the backup. While this is good you need to remember this when you are trying to restore your site. If you find yourself unable to access the site or add users, which are common actions when moving to a dev environment, then be sure to "unlock" your site. Here's some quick commands you can put in a batch file for backing up and restoring your sites. Have fun! Backup.bat @echo off IF "%1" == "" goto err IF "%2" == "" goto err2 setlocal set SITE=%1 set FILENAME=%2 ECHO Backing up %SITE% stsadm.exe -o setsitelock -url %SITE% -lock readonly stsadm -o backup -url %SITE% -filename E:\BackupFiles\%FILENAME% stsadm.exe -o setsitelock -url %SITE% -lock none if not errorlevel 0 goto err goto success REM error message if no argume...