Check user item permissions

how can I check with JavaScript in the Plumsail Form if a user from People Picker has permissions for the item and if so - what kind of permissions (View, Edit, Complete etc.)
Are special rights required to determine this or any user accessing the form can obtain this information?
Thank you

Dear @Cumatale,
That's an interesting question. Technically, you can use the following code to get a bitwise combination of enumeration values that specifies a set of permissions:

pnp.sp.web.lists.getByTitle('Your List Name')
  .items.getById(1).getUserEffectivePermissions(fd.field('Person Field Name').value.Key)

It will look like this:

It's technically a set of flags from here -

You can use this, as shown in this example -

P.S. If you need any help further adjusting the code for your needs, write us at [email protected] - this will take time to test and check, so it will likely have to be a paid support request.

this is the code in a button:

console.log("fd.field('Analist').value.Key=" + fd.field('Analist').value.Key);

And this is the console:

What did I do wrong?
Thank you!

Dear @Cumatale ,
Hmm, you use lists.getByTitle(), but instead of list title, you're using URL instead, why? There is no list with "http://intranet/procese/Lists/Change%20Request/AllItems.aspx" title.

Try to replace it with pnp.sp.web.lists.getByTitle('Change Request')

If this list in on a different site, you first need to define the web.

It works, thank you. But how ca I determine the permissions of all users on this item? I tried the code below:

pnp.sp.web.lists.getByTitle('Change Request')

but it didn't work:


@mnikitina or @Nikita_Kurguzov

I used your code like this.

var itemId = fd.itemId;

Now I´m getting this:


I would like to forward the user at certain permissions. But I can't get any further from here. Would you have an idea how I can implement this? And how do I know what exactly High and Low stand for?

Dear @Sternchen,
It's a mask for all permissions of the current user - How to get permission levels for Files/Folders/Documents in Sharepoint using rest endpoints? - Stack Overflow