locked
Custom XSLT Field Rendering of Edit button with Custom Permissions (Has Edit but not Add permissions) RRS feed

  • Question

  • Problem: OOB Lists does not render the Edit button when the user does'nt have Add Permissions.

    We have created a Custom Permissions called ViewAndEdit which has all View and Edit permissions enabled at the list level. No Add Permissions are provisioned for the above PermissionLevel.

    The OOB List when they are rendering it is not displaying the Edit button for people who are part of the above custom permission. I have observed that few others have also faced this issue but there was no resolution on it.

    The below link was the closest to the solution. But the issue was in the IfHasRight() function where they were checking for Add (mask = 2) Permissions instead of Edit (mask = 4) Permission.

    http://social.technet.microsoft.com/Forums/en-IE/sharepointgeneral/thread/f2ef3c57-3db9-4ee7-bd72-4d682fd3ee5d

    Any solution to the  above problem is greatly appreciated.

    Monday, May 14, 2012 8:03 AM

Answers

  • The only solution that I could figure out was to modify the IfHasRight function in

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XSL\fldtypes.xsl

    However, this may not be an accepted solution as it requires to modify the OOB file.

    <!-- ifhasrigth(4)-->
      <xsl:template name="IfHasRight" ddwrt:ghost="always">
        <xsl:param name="thisNode" select="."/>
        <xsl:variable name="mask" select="$thisNode/@PermMask"/>
        <xsl:variable name="bit" select="substring($mask, string-length($mask))"/>
        <xsl:choose>
          <xsl:when test="$bit = '4' or $bit = '5' or $bit = '6' or $bit = '7' or 
                          $bit = 'C' or $bit = 'c' or $bit = 'D' or $bit = 'd' or $bit = 'E' or $bit = 'e' or $bit = 'F' or $bit = 'f'">1</xsl:when>
          <xsl:otherwise>0</xsl:otherwise>
        </xsl:choose>
      </xsl:template>


    Monday, May 14, 2012 8:38 AM