Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getLockedByUser only returns the current user. not other with file open. #3148

Open
Ofer-Gal opened this issue Oct 9, 2024 · 0 comments
Open

Comments

@Ofer-Gal
Copy link

Ofer-Gal commented Oct 9, 2024

What version of PnPjs library you are using

4.x

Minor Version Number

4.5.0

Target environment

SharePoint Framework

Additional environment details

Tring to find out if anyone has a certain file open before checkout inside a SPFx webpart authenticating with the context.

Question/Request

The code

     const file: IFile = await projWeb.getFileByServerRelativePath("/teams/3000.005/DPCDocuments/Turn OFF OneDrive Syncing.docx")
        const o:ISiteUserProps = await file.getLockedByUser();
        if (o)    console.log(o.Title, o.LoginName);

shows my name and login when I am the one with the file open.
When someone else has the file open, o== null
Is there a way to make it aware of other users with the file open?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant