os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Add mountpoint filter based on user groups #83

Closed josephjeno closed 4 years ago

josephjeno commented 4 years ago

Currently it is possible to restrict access to mountpoints to particular user groups like below:

    mountpoints: [{
      name: 'shared',
      label: 'Shared',
      attributes: {
        root: path.resolve(root, 'vfs/shared'),
        groups: ['admin']
      }
     }]

And when a user in an unauthorized group tries to access it, they receive the below message:

image

It would also be great if we could filter the mountpoints that appear, so the user only sees those that they have access to. That would prevent instances where there are large numbers of mountpoints, but the user only has access to one or two.

andersevenrud commented 4 years ago

On it! :)

andersevenrud commented 4 years ago

This should take care of it: https://github.com/os-js/osjs-client/pull/84

Merging and releasing asap

andersevenrud commented 4 years ago

@osjs/client@3.1.10 is now out. Get it while it's hot :)

This change will now kick in when you add groups: [] to a mountpoint on the client.

andersevenrud commented 4 years ago
mountpoints: [{
  name: 'shared',
  label: 'Shared',
  attributes: {
    root: path.resolve(root, 'vfs/shared'),
    groups: ['admin']
  }
 }]

Note that the groups property is on the root object, not inside attributes :)

andersevenrud commented 4 years ago

Hold on. I think I might be wrong about my previous comment :man_facepalming:

josephjeno commented 4 years ago

awesome my dude, thanks very much! Excited to try this out.

andersevenrud commented 4 years ago

Yeah. I read it wrong on my end. Fixing that now :laughing:

andersevenrud commented 4 years ago

Okay. 3.1.11 is now out that makes the client-side configuration the same as server-side (i.e. groups is under attributes).

josephjeno commented 4 years ago

works perfectly