Search Wiki:

SPBasePermissions: STSADM extension

Updated: 2008-08-15

This is an stsadm extension that gets or sets base permissions for roles / permissions levels in a site / collection. The role or permission level is added to the site / collection if it is not defined.


Operation name : GetPermission

Gets the SPBasePermissions for a role/permission level for a given URL

Syntax
stsadm -o getpermission
  -url <full site url>
  -role <role name>

Parameters
Parameter Value Required Description
url Site / Collection URL Yes The full URL of the MOSS or WSS v3 Collection, Site or SubSite you want to view. Do not include page.
role A valid role or permission level Yes Name of the role or permission level you want to get permissions for. This name is case sensitive. For a complete list of roles, use the enumroles stsadm operation.

Operation name : SetPermission

Sets the SPBasePermissions for a role/permission level to a given URL

Syntax
stsadm -o setpermission
  -url <full site url>
  -role <role name>
  -basepermissions <p1, p2, ..., pN>

Parameters
Parameter Value Required Description
url Site / Collection URL Yes The full URL of the MOSS or WSS v3 Collection, Site or SubSite you want to view. Do not include page.
role Role or permission level to modify Yes The role or permission level you want to set permissions for.
basepermissions List of base permissions this role should have Yes This is a comma de-limited list of base permissions this role or permission level needs to have.

Note
  • If the role already exists, the SPWeb will be modified with the new base permissions.
  • If the a role with that name does not exist in the SPWeb, a new role will be created and the base permissions attached to it.
  • Inheritance from the parent site will be broken if you specify a child site.
  • List of base permissions available here - [url:http://msdn.microsoft.com/microsoft.sharepoint.spbasepermissions.aspx|
Last edited Aug 16 2008 at 1:48 AM  by Rajib, version 3
Comments
semtex007 wrote  Sep 18 at 1:00 PM  
Hi, I use the setpermissions during the batch creation of sites. Is there anyway the solution could be modified to include the description of the Role please. Whilst the OOB roles all have standard notation, the new ones created in our WSS world are blank. As we have 400+ websites, adding or adjusting a role is quite time consuming !!
Cheers, Ian

Updating...
Page view tracker