Comparing current Logged On user with another list RRS feed

  • Question

  • Hi, I have a custom-made (SPD) aspx form which uses the Tasks list.  Now, I want only users who are listed in my: TaskApprovers list to be able to set the Tasks.Status=Complete on the Tasks list.  For example, when a user clicks the Save button, a message would popup if they are not listed in the TaskApprovers list. 

    In short, I'd like to compare if the current Logged On user is within the TaskApprovers list.

    Any idea how? Thanks.

    Tuesday, December 20, 2011 3:04 PM

All replies

  • You could create a Sharepoint Group named TaskApprovers and set the AssignedTo field to this group, also you could set permissions for your item.



    Tuesday, December 20, 2011 4:35 PM
  • Fernando, I really need to compare who's logged on vs. a list of users.

    I was thinking more of using the ParameterBinding sections with a JavaScript hack somewhere.


    Tuesday, December 20, 2011 6:13 PM
  • Okay, using the   <ParameterBinding Name="LogonUser" Location="ServerVariable(LOGON_USER)" DefaultValue=""/> and other things I've been able to retrieve the current Logged On user. 

    Now if somebody has a way of comparing this value with a list of names from another list, it would be very helpful.



    Tuesday, December 20, 2011 6:53 PM
  • A little late but in the xslt

    <xsl:param name=”LogonUser”/>

    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[contains(normalize-space(@Manager_x0020_User_x0020_Id), $LogonUser)]"/> <xsl:variable name="count" select="count(/dsQueryResponse/Rows/Row[contains(normalize-space(@Manager_x0020_User_x0020_Id), $LogonUser)])"/>

    but my issue is dealing with case sensitivity.  My list was entered with all lower case, some of my Logon users are mixed cased
    • Proposed as answer by Craig Jahnke Friday, August 31, 2012 4:50 AM
    Tuesday, February 28, 2012 8:27 PM