Skip to content

Adds 'spo file roleassignment list' command. Closes #6191 - #7280

Open
nanddeepn wants to merge 8 commits into
pnp:mainfrom
nanddeepn:issue-6191-1
Open

nanddeepn wants to merge 8 commits into
pnp:mainfrom
nanddeepn:issue-6191-1

Conversation

@nanddeepn

Copy link
Copy Markdown
Contributor

Adds 'spo file roleassignment list' command. Closes #6191

Copilot AI review requested due to automatic review settings May 22, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds the ability to list SharePoint file role assignments via a new command and centralizes file/permissions retrieval logic in the spo utility.

Changes:

  • Updated SharePoint REST calls to use decodedUrl in GetFolderByServerRelativePath/GetFileByServerRelativePath requests
  • Added spo.getFileByUrl() and spo.getFileRoleAssignments() helpers and refactored spo file get to reuse them
  • Introduced new spo file roleassignment list command with tests and documentation

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/utils/spo.ts Adds helper methods for file retrieval and role assignments; updates REST parameter casing
src/utils/spo.spec.ts Updates URL expectations for decodedUrl and adds tests for new helpers
src/m365/spo/commands/file/file-roleassignment-list.ts New command to list role assignments for a file by URL or ID
src/m365/spo/commands/file/file-roleassignment-list.spec.ts Unit tests for the new command behavior and validation
src/m365/spo/commands/file/file-get.ts Refactors permission retrieval to use shared spo.getFileRoleAssignments()
src/m365/spo/commands/file/file-get.spec.ts Updates tests to stub spo.getFileRoleAssignments()
src/m365/spo/commands.ts Registers new command constant
docs/src/config/sidebars.ts Adds the new command doc to the sidebar
docs/docs/cmd/spo/file/file-roleassignment-list.mdx Adds documentation page for the new command

Comment thread src/utils/spo.ts Outdated
Comment thread src/utils/spo.spec.ts
Comment thread src/m365/spo/commands/file/file-roleassignment-list.spec.ts
Comment thread docs/docs/cmd/spo/file/file-roleassignment-list.mdx Outdated
Comment thread src/utils/spo.spec.ts Outdated
Comment thread src/utils/spo.spec.ts Outdated
@milanholemans

Copy link
Copy Markdown
Contributor

Thanks, we'll try to review it ASAP!

This comment was marked as resolved.

@MartinM85

Copy link
Copy Markdown
Contributor

Hi @nanddeepn, could you please check the findings from Copilot? Thank you

@nanddeepn

Copy link
Copy Markdown
Contributor Author

Hi @MartinM85
Done

@MartinM85 MartinM85 self-assigned this Oct 17, 2026

@MartinM85 MartinM85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @nanddeepn 🚀
Looks good overall, just a few tiny things to consider. One major thing is to use the Zod schema for command options, but our AI skill can help you save a time.

Comment thread docs/docs/cmd/spo/file/file-roleassignment-list.mdx
Comment thread docs/docs/cmd/spo/file/file-roleassignment-list.mdx Outdated
Comment thread docs/docs/cmd/spo/file/file-roleassignment-list.mdx Outdated
Comment thread src/m365/spo/commands/file/file-roleassignment-list.ts Outdated
@MartinM85
MartinM85 marked this pull request as draft October 18, 2026 15:58
@nanddeepn
nanddeepn marked this pull request as ready for review October 23, 2026 09:07
@MartinM85
MartinM85 requested a lite review from Copilot October 24, 2026 07:33

This comment was marked as resolved.

@MartinM85 MartinM85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nanddeepn, thank you for the contribution 🚀
Only one note from my side regarding the text output. As Copilot noticed, the doc has missing Permissions section.

Comment thread docs/docs/cmd/spo/file/file-roleassignment-list.mdx Outdated
@MartinM85
MartinM85 marked this pull request as draft October 24, 2026 09:08
@nanddeepn
nanddeepn marked this pull request as ready for review October 24, 2026 09:15

@MartinM85 MartinM85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. I will merge it later.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New command: spo file roleassignment list

4 participants