Tip: Add the allowed directories as shortcuts in the file explorer

If you’re me, then you set a whitelist of directories to be accessible by OOD.

https://osc.github.io/ood-documentation/latest/customization.html#block-or-allow-directory-access

pun_custom_env:
  OOD_ALLOWLIST_PATH: "/work:/home:/project:/scratch:/modules:/nas:/datasets"

But then, you realized that users can no longer navigate to root. Now each of these directories need to be added as shortcuts, to prevent frustration.

https://osc.github.io/ood-documentation/latest/customization.html#add-shortcuts-to-files-menu

But,

you can make this robust. There is no need to hard code the list in two places, because the whitelist environment variable is exposed to the dashboard app ruby initializers.

OodFilesApp.candidate_favorite_paths.tap do |paths|
    allowlist = ENV["OOD_ALLOWLIST_PATH"].split(":")
    paths.concat allowlist.map { |p| FavoritePath.new("#{p}")  }
end

This makes perfect sense. All the directories that they have access to, they have easy access to. And if the list needs to be updated, it only needs to be updated in one place.

1 Like