cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

🔐 set alias for `listitem roleinheritance break/reset` to `file` and `folder` namespace

Open Adam-it opened this issue 3 years ago • 1 comments

currently we have a perfectly working command listitem roleinheritance break and listitem roleinheritance reset which will also allow to break/reset role inheritance on file and folder but still it will be easier for the users to discover those commands when we will have those as well on file and folder namespace like file roleinheritance break etc. The aim of this issue is to add alias to:

  • listitem roleinheritance break for file roleinheritance break and folder roleinheritance break
  • listitem roleinheritance reset for file roleinheritance reset and folder roleinheritance reset

Adam-it avatar Aug 02 '22 23:08 Adam-it

@waldekmastykarz how could I go about it 🤔? do we already have somewhere aliases in the CLI used? Thanks for any tip which will point me in the right direction. @pnp/cli-for-microsoft-365-maintainers any additional comments on how we should approach this?

Adam-it avatar Aug 07 '22 20:08 Adam-it

ok I got an advice on how to do it from @garrytrinder , @plamber , @arjunumenon on a call 👍. I will assign it to myself and do it

Adam-it avatar Aug 11 '22 09:08 Adam-it

ok I got an advice on how to do it from @garrytrinder , @plamber , @arjunumenon on a call 👍. I will assign it to myself and do it

Would you mind sharing it here for future reference and evaluation of the PR?

waldekmastykarz avatar Aug 18 '22 08:08 waldekmastykarz

Would you mind sharing it here for future reference and evaluation of the PR?

yes. Sorry for not being specific about it 😉. So the idea is to use alias similar like we have between user add and o365Group user add commands

https://github.com/pnp/cli-microsoft365/blob/main/src/m365/aad/commands/o365group/o365group-user-add.ts#L30:~:text=public%20alias(,%7D

Adam-it avatar Aug 18 '22 10:08 Adam-it

yes. Sorry for not being specific about it 😉. So the idea is to use alias similar like we have between user add and o365Group user add commands

Understood. For a file or folder, wouldn't you expect to be able to manage permissions through their name, which wouldn't be applicable to a list item? If so, that would require to introduce an option that's relevant only for some aliases, which might end up confusing. Any thoughts on that?

waldekmastykarz avatar Aug 18 '22 12:08 waldekmastykarz

Understood. For a file or folder, wouldn't you expect to be able to manage permissions through their name, which wouldn't be applicable to a list item? If so, that would require to introduce an option that's relevant only for some aliases, which might end up confusing. Any thoughts on that?

TBH no 😅. I wasn't planning on extending the list of options with specific for files and folder. But if you feel like this would not make much sense we may abort this issue and open separate for each command for file and folder. Then in each command we may add the additional options to get for example file by name and use it's ID to pass to execute the already existing command for list item. That way we will still reuse the code as much as we can but also have possiblity to expose options more context specific. @waldekmastykarz let me know what you think? For me both options are ok. I think the second (separate command for each) is of course a bit of work but is better and I may take it as well.

Adam-it avatar Aug 18 '22 23:08 Adam-it

While it's a bit more work, it would be clearer to have separate commands and avoid confusion like "what is a file name for a list item?"

waldekmastykarz avatar Aug 19 '22 06:08 waldekmastykarz

While it's a bit more work, it would be clearer to have separate commands and avoid confusion like "what is a file name for a list item?"

@waldekmastykarz totally. I agree 👍 It will be a lot more convenient for the users this way and this is what is most important 👍. I will close this issue indicate in the https://github.com/pnp/cli-microsoft365/issues/3540 issue that we should also add separate command for those 😉. I will create separate issues for each of those over the weekend as currently I am mainly over the phone trying to be offline to do a bit of recharge 😋. Thanks for you feedback and brainstorm on this one. you rock 🤩

Adam-it avatar Aug 19 '22 08:08 Adam-it