Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Querying folder permissions

  Asked By: Faith    Date: Sep 10    Category: Sharepoint    Views: 1074

Everything in sharepoint seems to be like a treasure hunt for me. I'm
trying to create a web part that part of the functionality requires
that the web part knows the user's access rights at the folder level
the web part lives in. I'm using this code to see if the user is a
coordinator but I have no idea what it means, all I know is it works.
I know its referencing some functions from the TahoeUtils.Asp file.
Can any of you tell me how to modify the code below in order to be
able to figure out if a user is an author?? Thank you very much.

blnReducedFunctionalityMode = true

Dim boolIsCoordinator
boolIsCoordinator = TestRights(ReadParameterFromGetOrPost("DataUrl"),

If boolIsCoordinator Then

blnReducedFunctionalityMode = false

End If



1 Answer Found

Answer #1    Answered By: Tonia Franco     Answered On: Sep 10

This is a reply for the question how to modify  the code  below in order  to be

able to figure  out if a user  is an author??.

The function you are calling at is:


' Tests current user's right to the folder


' [IN] strFolderURL - URL of folder  user's rights  are to be
tested on

' [IN] strAccessToTest - "0" to "4" permissions  levels (refer to
ACCESS constants)

' [OUT] strActual - the actual rights the user has

' RETURNS True / False - If user has equal or greater rights Then
specified in strAccessToTest

Function TestRights(strFolderURL, strAccessToTest)

dim bRights

strFolderURL = TestSlash(strFolderURL)

bRights = TestCurrentUserRights(strFolderURL, strAccessToTest)

TestRights = bRights

End Function

This is a function of the file  project.vbs from the folder

See that in your code you pass:
TestRights(ReadParameterFromGetOrPost("DataUrl"), 4)

Where the access  constant are:

' AccessRight values



CONST ACCESS_AUTHOR = "2" ' not currently used in solutions



Just change this number to 2, and then check new permissions (the authors one)in
the if sentence: If ___ Then …

One more think: Never try to modify any of the files in resources folder. Beware
that Microsoft may not provide support for any SharePoint installation in which
any of these files have been modified.

To know more about those files, read this document I found don’t remember
where. It is very, very useful to find the code.

Didn't find what you were looking for? Find more on Querying folder permissions Or get search suggestion and latest updates.