go-passbolt-cli icon indicating copy to clipboard operation
go-passbolt-cli copied to clipboard

Adds permission command to get a list of permissions applied on a Resource

Open froque opened this issue 1 year ago • 2 comments

froque avatar Aug 10 '24 00:08 froque

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 10 '24 00:08 CLAassistant

Hi, Thanks for the PR.

The Command you implemented is is using the name permission and lists Resource Permissions But Folders also have Permissions and we might want to add a Command for that in the Future too. Any Ideas on how to Resolve this conflict? Maybe the command could be list resource permission instead of just list permission which would also allow for list folder permission.

speatzle avatar Aug 13 '24 08:08 speatzle

I did not known that folders could also have permissions, but this pull request could easily be extended to support folders, by adding a --folder flag to the permission subcommand matching the --resource flag.

But your question made me rethink this. This is a list of options that could also be implemented:

Option 1 (expands from this PR):

./go-passbolt-cli list permission --resource cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli list permission --folder f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Option 2 (suggestion):

./go-passbolt-cli list resource permission --id cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli list folder permission --id f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Option 3:

./go-passbolt-cli list permission resource --id cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli list permission folder --id f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Option 4:

./go-passbolt-cli permission resource --id cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli permission folder --id f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Option 5:

./go-passbolt-cli permission --resource cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli permission --folder f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Option 6:

./go-passbolt-cli get resource permission --id cf984ed8-28bc-4722-aa7b-07a8e3d6ad3c
./go-passbolt-cli get folder permission --id f6d16be2-3313-4a48-b1ba-6fe03ce7e78e

Since I imagine the main use case is to list permissions for a specific resource/folder and not a list of resources/folders, I think this should be option 6, associated with the get command and not the list command. I have created a new PR #63 with this option.

froque avatar Sep 30 '24 16:09 froque

Superseded by #63, Thanks.

speatzle avatar Oct 07 '24 13:10 speatzle