Closed jgq85 closed 3 months ago
Hi @jgq85 !
Is this permission based?
No, it isn't. Unfortunately, List Formatting does not allow you to get permissions, and coding with them is not possibleπ’ Therefore, the toolbar is visible to all users who can see the item.
It is possible to do things like "display it if the current user is included in a specific column" or "display it if the current user is included in a specific email address", as in the following code.
"style": {
"display":"=if(indexOf([$MultiSelectUserColumn.email],@me)>-1,'','none')"
}
"style": {
"display":"=if(indexOf('user1@contoso.com; user2@contoso.com',@me)>-1,'','none')"
}
Reference: Formatting syntax reference - @me
Hi @jgq85 !
Is this permission based?
No, it isn't. Unfortunately, List Formatting does not allow you to get permissions, and coding with them is not possibleπ’ Therefore, the toolbar is visible to all users who can see the item.
It is possible to do things like "display it if the current user is included in a specific column" or "display it if the current user is included in a specific email address", as in the following code.
"style": { "display":"=if(indexOf([$MultiSelectUserColumn.email],@me)>-1,'','none')" }
"style": { "display":"=if(indexOf('user1@contoso.com; user2@contoso.com',@me)>-1,'','none')" }
Reference: Formatting syntax reference - @me
Sorry I didn't realize that toolbar was always shown. I thought that "X" would delete the row. The preview page screenshot doesn't show it fully expanded. Is there a way to just keep it collapsed? It looks too cluttered when the toolbar is fully shown for every row.
Sooooooooo sorry... looking back at the code, I realized I was wrong., List Formatting probably allows you to get permissions, and this sample was using [$PermMask]
to show and hide menus according to permissions.
If [$PermMask]
was 0xb008431061 (probably view only permission), the toolbar was not displayed.
Is there a way to just keep it collapsed?
The toolbar is controlled by the value of the Expand
column, which may or may not be displayed. If you do not want it to be displayed, just set it to No.
Clicking on the icon updates the value in the Expand
column.
If you do not want to control the display and hiding by column values, you can also display a toolbar on a custom card as follows.
PermMask was mentioned in the following article. https://www.sharepointpro.com.au/blog/hiding-columns-based-on-permission-levels/
Regarding the values for each permission, the values in the code differed from those in the article above. (In the code it says 0xb008431061, but in the article it says 0xb008431041)
I am not familiar with PermMask and do not know if either is correct. Sorryπ’ (I only learned about PermMask todayπ±)
SharePoint Online. I am trying the Discussion Board list.
I think I have all the fields added per the read-me and I added the JSON formatting, however it looks like this which has an editing type toolbar above each post. Is this permission based? Or sort of clutters so wondering how to fix.