Connect.Collaborate.SharePoint

SharePoint Data View Conditional Formatting based on user permissions

In your Data View or Data Form web part, you can conditionally display content based on the ddwrt:IfHasRights() function.

<xsl:if test="ddwrt:IfHasRights(permissionMask)">
something...
</xsl:if>

Trying to get info on values for permissionMask from the advanced conditional formatting dialog box was not possible because there is no scrolling of this information in the UI (bug)

After a bit of searching, I found the values in C:\Program Files (x86)\Microsoft Office\Office12\CAML2XSL.XSL

The permissinMask value is the sum of any of the values below:

ViewListItems - 1

AddListItems - 2

EditListItems - 4

DeleteListItems - 8

ApproveItems - 16

OpenItems - 32

ViewVersions - 64

DeleteVersions - 128

CancelCheckout - 256

PersonalViews - 512

ManageLists - 2048

ViewFormPages - 4096

Open - 65536

ViewPages - 131072

AddAndCustomizePages - 262144

ApplyThemeAndBorder - 524288

ApplyStyleSheets - 1048576

ViewUsageData - 2097152

CreateSSCSite - 4194314

ManageSubwebs - 8388608

CreateGroups - 16777216

ManagePermissions - 33554432

BrowseDirectories - 67108864

BrowseUserInfo - 134217728

AddDelPrivateWebParts - 268435456

UpdatePersonalWebParts - 536870912

ManageWeb - 1073741824

UseRemoteAPIs - 137438953472

ManageAlerts - 274877906944

CreateAlerts - 549755813888

EditMyUserInfo - 1099511627776

EnumeratePermissions - 4611686018427387904

FullMask - 9223372036854775807

Posted by Ian Morrish on Saturday, 4 Aug 2007 10:43 | 9 Comments
SharePoint

Links to this post

[...] [...]

Pingback from Custom Forms – Role trimming the columns « Brian Blogs on SharePoint on 13 Oct 2009 06:17

Comments


Thursday, 13 Mar 2008 04:39 by Sam
Thank you very much This article helped me a lot.............. Good job


Friday, 21 Mar 2008 01:29 by
RedVandelay
Good summary (btw: the dialog is resizable). Using the GetRolesAndPermissionsForCurrentUser you can see the base perm mask values for standard roles: Name="Full Control" .. BasePermissions="9223372036854775807" Name="Contribute" .. BasePermissions="1856436900591" Name="Read" .. BasePermissions="756052856929" Name="View Only" .. BasePermissions="756052856897"


Tuesday, 26 Aug 2008 01:32 by Patrick
Thanks man. Quick and Painless.


Monday, 22 Sep 2008 06:46 by Wim de Smit
Many thanks!


Friday, 26 Sep 2008 06:13 by Alan P
Great post, searching google for ages for this, thanks!


Saturday, 20 Dec 2008 02:37 by Marco Valli
Wonderful!!! :) thanks for your great job!!! pingback from http://vallimarco.spaces.live.com


Friday, 16 Jan 2009 01:55 by Anubhav
Ausome....This saved atleast a days Rnd...thanks for the amazing post...keep going...


Thursday, 25 Jun 2009 01:16 by DanielS
The following related article (http://blog-sharepoint.blogspot.com/2009/05/data-view-conditional-formatting-using.html) demonstrates how to create a Data View web part with conditional formatting using SharePoint Designer based on metadata values. The focus is conditional formatting base on dates (start and due dates), as well as the priority for each item in a list to produce a result with colours (text and/or background) formatted to indicate priority or the length of time until due.


Wednesday, 17 Feb 2010 11:41 by How to check the current User logged in with the Assigned to column in the list using Conditional formatting?
Hi I have a custom list I want to check the current user logged in with the 'Assigend To' column in the Editform.aspx in Sharepoint Designer using Conditional Foramting Any Idea ? Thanks Harish

Name

Url

Email

Comments

CAPTCHA Image Validation