2020-04-04 02:18:47 -04:00
---
page_type: sample
products:
- office-sp
languages:
- javascript
- typescript
extensions:
contentType: samples
technologies:
- SharePoint Framework
platforms:
- react
createdDate: 12/1/2017 12:00:00 AM
---
2020-11-08 23:41:49 -05:00
# Security Grid
2017-12-01 09:38:51 -05:00
## Summary
2018-04-27 11:19:09 -04:00
2021-02-23 00:37:36 -05:00
React-securitygrid is an SPFX web part that uses React and Office-UI-Fabric to render a grid showing which users have access to which lists/libraries/folders/files on a Web as shown here:
2017-12-01 09:38:51 -05:00
2020-04-06 21:50:19 -04:00
![config panel ](./src/images/MainDisplay.gif )
2017-12-01 09:38:51 -05:00
2020-10-31 00:46:20 -04:00
Empty libraries are displayed with a black folder icon, those with items are displayed with a white folder. The user can expand a list or library by clicking on the desired row. (If the library or folder has more than 5000 items an error will be displayed ) For deeply nested folders the Title column can be resized by drag and drop. The display shows a the appropriate icon circle if the user has the selected permission to the given list, library, file or folder. (NOTE:The grid does not currently take into account access give via membership in an active directory group-- coming soon!). IMPORTANT: The user must have permissions to access lists and enumerate permissions in order to view the grid.
2017-12-01 09:38:51 -05:00
2020-10-31 00:46:20 -04:00
The user can change the permission being tested by clicking the Permission in the command bar and selecting a new Permission:
2017-12-01 09:38:51 -05:00
![permission panel ](./src/images/selectPermissionsPopout.PNG )
2020-04-15 14:31:09 -04:00
The user can change which users are being shown in the grid by selecting the users button in the command bar and selecting a desired users:
2017-12-01 09:38:51 -05:00
![Select users ](./src/images/SelectUsersPopout.PNG )
2020-04-15 14:31:09 -04:00
The user can change which lists are being shown in the grid by selecting the lists button in the command bar and selecting a desired lists:
2017-12-01 09:38:51 -05:00
![Select Lists ](./src/images/Selectlistspopout.PNG )
The user can change alternate between displaying user names and emails selecting the Show Email/Show Name button in the command bar and selecting the desired option:
![Select Mode ](./src/images/SelectDisplayModePopout.PNG )
2021-04-26 02:08:59 -04:00
The the first configuration panel of the web part is shown below:
2017-12-01 09:38:51 -05:00
![config panel ](./src/images/Configuration.PNG )
2020-04-15 14:31:09 -04:00
Permission Settings
2017-12-01 09:38:51 -05:00
2020-04-06 21:50:19 -04:00
The Permission Settings allow you to select which permissions to show in the grid and to select the Icon and color used to display the selected permission.
2017-12-01 09:38:51 -05:00
2020-04-15 14:31:09 -04:00
User Settings
2017-12-01 09:38:51 -05:00
The Show Email or Name Toggle determines whether the name or email is displayed by default.
The Show Security Groups checkbox determines whether SharePoint Security groups are included in the grid.
The Show Users checkbox determines whether Users are included in the grid.
2020-10-31 00:46:20 -04:00
The Only show users with permissions toggle determines whether the grid should display all users with access to the web, or only users with the selected permission
2020-04-06 21:50:19 -04:00
![config panel ](./src/images/Permissions.gif )
2017-12-01 09:38:51 -05:00
The Let Users Select users checkbox determines whether Users can filter the selected users in the grid.
2020-04-15 14:31:09 -04:00
Display Settings
2017-12-01 09:38:51 -05:00
The Initial Title column width determines the initial width of the Title column(it can be resized).
2020-10-31 00:46:20 -04:00
The second configuration panel allows the owner to configure the List Settings
![List Configuration panel ](./src/images/ListConfiguration.PNG )
2017-12-01 09:38:51 -05:00
2020-04-15 14:31:09 -04:00
List Settings
2017-12-01 09:38:51 -05:00
The Show Hidden Lists checkbox determines whether Hidden lists are displayed.
The Show System Lists checkbox determines whether System Lists (Catalogs) are included in the grid.
The Show Users checkbox determines whether Users are included in the grid.
The Let Users Select lists checkbox determines whether Users can filter the selected lists in the grid.
2020-04-15 14:31:09 -04:00
Select Lists
2017-12-01 09:38:51 -05:00
The Include/Exclude Selected lists Toggle determines whether the lists selected are to be included or excluded.
The admin can select lists and libraries below to have them included/excluded from the grid
## Notes
2018-04-27 11:19:09 -04:00
2017-12-01 09:38:51 -05:00
This is a port of an Angular 1.3 SharePoint hosted App at https://github.com/russgove/SPSecurity.
2021-02-23 00:37:36 -05:00
## Compatibility
![SPFx 1.10 ](https://img.shields.io/badge/SPFx-1.10.0-green.svg )
![Node.js LTS 6.x | LTS 8.x ](https://img.shields.io/badge/Node.js-LTS%206.x%20%7C%20LTS%208.x-green.svg )
![SharePoint Online ](https://img.shields.io/badge/SharePoint-Online-yellow.svg )
![Teams N/A: Untested with Microsoft Teams ](https://img.shields.io/badge/Teams-N%2FA-lightgrey.svg "Untested with Microsoft Teams" )
![Workbench Hosted: Does not work with local workbench ](https://img.shields.io/badge/Workbench-Hosted-yellow.svg "Does not work with local workbench" )
2017-12-01 09:38:51 -05:00
## Applies to
2020-06-09 03:09:22 -04:00
* [SharePoint Framework Developer Preview ](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview )
* [Office 365 developer tenant ](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-developer-tenant )
2017-12-01 09:38:51 -05:00
## Prerequisites
> React, Office-UI-Fabric, sp-pnp-js, lodash
## Solution
Solution|Author(s)
--------|---------
2021-02-23 00:37:36 -05:00
react-securitygrid | Russell Gove ([@russgove](https://twitter.com/russgove))
2017-12-01 09:38:51 -05:00
## Version history
Version|Date|Comments
-------|----|--------
2021-03-11 01:10:11 -05:00
1.0.5.0|March 6, 2021 | Added webApiPermission request
2021-02-23 00:37:36 -05:00
1.0.0.4|February 22, 2021 | Added support for AD groups
2020-10-31 00:46:20 -04:00
1.0.0.3|October 28, 2020 | Update to office-ui-fabric-react 7.148.1, fixing icons and indentation for sub-folders
2020-04-15 14:31:09 -04:00
1.0.0.2|April 5, 2021| Updates to SPFx 1.10; Allow display of multiple permissions
2018-04-27 11:19:09 -04:00
1.0.0.1|April 25, 2018|Update to SPFx 1.4.1
1.0.0.0|December 31, 2016|Initial version
2017-12-01 09:38:51 -05:00
## Disclaimer
2018-04-27 11:19:09 -04:00
2017-12-01 09:38:51 -05:00
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
---
## Minimal Path to Awesome
- Clone this repository
- in the command line run:
- `npm install`
- `gulp serve`
2019-04-15 05:49:10 -04:00
< img src = "https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-securitygrid" / >