Generating a folder access report

LabKey Support Forum
Generating a folder access report jgane  2020-06-25 12:28
Status: Active
 

Hi,

I was wondering if there is a way to generate a list of all users that have access to a folder for every folder/subfolder on LabKey? Essentially we want to collect the /folderAccess.view page for every folder into something like a JSON.

We tried using the R API to pull a list of all the folders on LabKey and then querying the core.Users table for each folder, however we ran into an issue where if a user is a part of a project group, they will show up in the core.Users table for every subfolder regardless of whether they actually have access to that subfolder or not. Even if that project group is not added to any folders and has no ability to access anything in that project, the users in that group will still show up in the core.Users table for every subfolder.

In case it helps we are running on version 20.3.

Any suggestions or ideas would be appreciated.

Thanks,
Jon

 
 
chetc (LabKey Support) responded:  2020-07-15 16:10
Status: Closed

Hello Jon,

Project groups are applied to the particular project and the folders beneath it, which explains why you're seeing the group show up in core.Users for the subfolders. I'm not sure if there is a simple way to collect the data you're after in a JSON like format. I can check with the devs to see if they have any ideas. I poked around in the R API and found that labkey.getFolder can be used to get the permission level of the current user for the folder it's called on, but that doesn't give you all of the users that have access. Would you mind sharing your R script, so I can take a look?

  1. Is there a particular type of access you are trying to locate (Ex: Reader, Editor)

Thanks,
Chet