question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

command spo folder roleinheritance break and reset does not work with rootfolder or site relative of folder

See original GitHub issue

Description

Command spo folder roleinheritance break and spo folder roleinheritance reset throw an error when root folder of a library or preceding slash is present in the folderUrl parameter.

Aim :

  1. Add flexibility to pass preceding slash in the parameter value folderUrl without any errors e.g. m365 spo folder roleinheritance reset --webUrl “https://contoso.sharepoint.com/sites/Test_Site” --folderUrl “/Shared Documents/FolderPermission”

  2. Allow the root folder url of a library to be passed as parameter value folderUrl e.g. m365 spo folder roleinheritance break --webUrl “https://contoso.sharepoint.com/sites/Test_Site” --folderUrl “/Shared Documents”

Implementation:

  1. To implement aim 1 , use const serverRelativeUrl: string = urlUtil.getServerRelativePath(args.options.webUrl, args.options.folderUrl);

to handle different ways the folderUrl value can be passed, i.e.

  • with preceding slash
  • no preceding slash
  • server relative url
  1. To implement aim 2 to allow root folder to be used , a condition can be added to check whether folderUrl value passed is a root folder and use the appropriate api call

const roleFolderUrl: string = urlUtil.getWebRelativePath(args.options.webUrl, args.options.folderUrl); let requestUrl: string = ${args.options.webUrl}/_api/web/`;

  if (roleFolderUrl.split('/').length === 2) {
    requestUrl += `GetList('${formatting.encodeQueryParameter(serverRelativeUrl)}')`;
  }
  else {
    requestUrl += `GetFolderByServerRelativeUrl('${encodeURIComponent(serverRelativeUrl)}')/ListItemAllFields`;
  }

`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
martinlingstuylcommented, Oct 16, 2022

As far as I am concerned you can fix both in the same issue. 👍

But do please update the issue spec first so it’s clear what you are going to do.

1reaction
reshmee011commented, Oct 16, 2022

@martinlingstuyl : I have updated the description of the issue to look more like a spec, please review .

Read more comments on GitHub >

github_iconTop Results From Across the Web

folder roleinheritance break - CLI for Microsoft 365
Break the inheritance of the specified root folder for the library with a specified server-relative URL. It will clear the existing permissions of...
Read more >
Unable to share or break inheritance in SharePoint and ...
Fixes an issue in which you can't share or break inheritance of a folder, list, or library because of too many uniquely permitted...
Read more >
Delete Unique Permissions (Reset Broken Inheritance) in ...
We can reset the permission inheritance and delete unique permissions for a site/web/folder/item level where the inheritance is previously broken.
Read more >
Chapter 8 – Reading and Writing Files
Any filenames or paths that do not begin with the root folder are assumed to ... The relative paths for folders and files...
Read more >
About linking and navigation - Adobe Support
Site root–relative paths describe the path from the site's root folder to a document. You may want to use these paths if you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found