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

Merge for 1.13.0 #278

Merged
merged 61 commits into from
Apr 24, 2019
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1ff6c8b
progress control - work in progress
AJIXuMuK Feb 1, 2019
3b5ebe7
Progress component - done
AJIXuMuK Feb 2, 2019
11e33c5
small doc fix
AJIXuMuK Feb 2, 2019
12b825d
error icon change; added props to overwrite icons; hasError prioritiz…
AJIXuMuK Feb 5, 2019
4d9741b
merge with dev
Feb 15, 2019
35d3aaf
lost export
Feb 15, 2019
4ee0598
Updated web part title documentation
hugoabernier Feb 24, 2019
fe2bd9a
Added screen shot of web part title with "see all"
hugoabernier Feb 24, 2019
fe8f38a
Added moreLink prop
hugoabernier Feb 24, 2019
93a1020
Added logic to render if no title is provided, but morelink is
hugoabernier Feb 24, 2019
398a6c8
Update ListView.md: iconFieldName description
PzKfWg Feb 28, 2019
2f491f5
interface for DateTime strings
ltdu Mar 2, 2019
c46e98e
translations
ltdu Mar 2, 2019
ceaa551
use coresponding resource
ltdu Mar 2, 2019
6277e44
change person photo url
ltdu Mar 2, 2019
66496cc
remove private field
ltdu Mar 3, 2019
484cf8a
Update ListItemAttachments.md
moersoy Mar 13, 2019
823d18a
Merge changes
estruyf Mar 28, 2019
404713f
Updates + code refactoring on the RichText control
estruyf Mar 28, 2019
a54ae46
Merge branch 'hugoabernier-feature-richtext' into dev
estruyf Mar 28, 2019
d39aa0c
Version updates + changelog
estruyf Mar 28, 2019
8da7129
Merge branch 'hb-webparttitle' of https://github.com/hugoabernier/sp-…
estruyf Mar 28, 2019
4f2e1c8
Documentation changes + sample update
estruyf Mar 28, 2019
ec706d4
Merge branch 'hugoabernier-hb-webparttitle' into dev
estruyf Mar 28, 2019
8456bce
Updated changelog + documentation
estruyf Mar 28, 2019
ee037d5
#260 - Added support for PDF icon file type
estruyf Mar 28, 2019
134bfec
Updated the changelog
estruyf Mar 28, 2019
e387370
Code merge + refactoring for #230
estruyf Mar 29, 2019
f5107ed
Merge branch 'AJIXuMuK-progress-control' into dev
estruyf Mar 29, 2019
c1bec92
Update RichText.md
hugoabernier Jan 2, 2019
c1f44de
Updated changelog
estruyf Mar 29, 2019
128371f
Merge branch 'dev' of github.com:SharePoint/sp-dev-fx-controls-react;…
estruyf Mar 29, 2019
3d209a3
Merge branch 'PzKfWg-patch-1' into dev
estruyf Mar 29, 2019
6d0526b
Updated changelog
estruyf Mar 29, 2019
ab7117d
Merge branch 'lt-translations' of https://github.com/ltdu/sp-dev-fx-c…
estruyf Mar 29, 2019
f72ca6c
Merge branch 'ltdu-lt-translations' into dev
estruyf Mar 29, 2019
1c13600
Updated changelog
estruyf Mar 29, 2019
2d31614
Merge branch 'people-picker-photo' of https://github.com/ltdu/sp-dev-…
estruyf Mar 29, 2019
9462fb3
Merge branch 'ltdu-people-picker-photo' into dev
estruyf Mar 29, 2019
29d0910
Update changelog
estruyf Mar 29, 2019
81a61c5
Merge pull request #254 from moersoy/patch-1
estruyf Mar 29, 2019
c005c9e
Merge branch 'dev' of github.com:SharePoint/sp-dev-fx-controls-react …
estruyf Mar 29, 2019
892b624
Updated changelog
estruyf Mar 29, 2019
9126ec4
#21 - code refactoring + MaskTextField implemention
estruyf Mar 29, 2019
38c6654
Updated localization
estruyf Mar 29, 2019
bb0c93a
Calculates richtext toolbar top. Fixes #265.
hugoabernier Apr 3, 2019
2ba15dc
* Extended functionality to folder and item-level
Apr 8, 2019
509525c
* Minor correction.
Apr 8, 2019
20bace4
Changed the name of the new function
Apr 8, 2019
fea5f3e
Merge branch 'SherpasGroup-AddDateTimePickerControl' into dev
estruyf Apr 9, 2019
d32fd65
Updated changelog
estruyf Apr 9, 2019
5321560
Merge branch 'dev' of https://github.com/hugoabernier/sp-dev-fx-contr…
estruyf Apr 24, 2019
69e5616
Merge branch 'hugoabernier-dev' into dev
estruyf Apr 24, 2019
3b8d8b9
Updated changelog
estruyf Apr 24, 2019
b425799
Merge branch 'dev' of https://github.com/Varuuna/sp-dev-fx-controls-r…
estruyf Apr 24, 2019
9d47d8c
#271 - Better implementation for the item and folder checks
estruyf Apr 24, 2019
36b73a2
Merge branch 'Varuuna-dev' into dev
estruyf Apr 24, 2019
074ee83
Updated changelog + documentation
estruyf Apr 24, 2019
2d2d1fb
#275 - Fix for single quotes around the people picker class
estruyf Apr 24, 2019
6728550
Updated changelog
estruyf Apr 24, 2019
9cf0ba6
Small fix for onChange event in RichText
estruyf Apr 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -25,4 +25,12 @@ export interface ISecurityTrimmedControlProps {
* The relative URL of the list or library. Required when you want to check permissions on remote list.
*/
relativeLibOrListUrl?: string;
/**
* Optional. Specify the name of a folder to check the user permissions against. Will be overridden if itemId is present.
*/
folderPath?: string;
/**
* Optional. Specify the ID of the item to check the user permissions against. Takes precedence over folder.
*/
itemId?: number;
}
32 changes: 28 additions & 4 deletions src/controls/securityTrimmedControl/SecurityTrimmedControl.tsx
Original file line number Diff line number Diff line change
@@ -28,9 +28,11 @@ export class SecurityTrimmedControl extends React.Component<ISecurityTrimmedCont
public componentDidUpdate(prevProps: ISecurityTrimmedControlProps, prevState: ISecurityTrimmedControlState): void {
// Check permissions only if necessary
if (prevProps.level !== this.props.level ||
prevProps.permissions !== this.props.permissions ||
prevProps.relativeLibOrListUrl !== this.props.relativeLibOrListUrl ||
prevProps.remoteSiteUrl !== this.props.remoteSiteUrl) {
prevProps.permissions !== this.props.permissions ||
prevProps.relativeLibOrListUrl !== this.props.relativeLibOrListUrl ||
prevProps.remoteSiteUrl !== this.props.remoteSiteUrl ||
prevProps.folderPath !== this.props.folderPath ||
prevProps.itemId !== this.props.itemId) {
this.checkPermissions();
}
}
@@ -70,7 +72,7 @@ export class SecurityTrimmedControl extends React.Component<ISecurityTrimmedCont
const { context, remoteSiteUrl, permissions } = this.props;
if (remoteSiteUrl && permissions) {
for (const permission of permissions) {
const apiUrl = `${remoteSiteUrl}/_api/web/DoesUserHavePermissions(@v)?@v=${JSON.stringify(permission.value)}`;
const apiUrl = this.checkPermissionOnResource();
const result = await context.spHttpClient.get(apiUrl, SPHttpClient.configurations.v1).then(data => data.json());
// Check if a result was retrieved
if (result) {
@@ -148,6 +150,28 @@ export class SecurityTrimmedControl extends React.Component<ISecurityTrimmedCont
}
}

private checkPermissionOnResource() {
const { remoteSiteUrl, relativeLibOrListUrl, folderPath, itemId } = this.props;

// Check permission on a specific item.
if (itemId) {
const splitUrl = relativeLibOrListUrl.split('/');
var lastSegment = splitUrl.pop() || splitUrl.pop(); // Trims trailing slash if it exists.

return `${remoteSiteUrl}/_api/web/Lists/GetByTitle(@listTitle)/items(@itemId)/EffectiveBasePermissions?@listTitle='${encodeURIComponent(lastSegment)}'&@itemId='${itemId}'`;
}
// Check permission on a specific folder.
else if (folderPath) {
const folderByServerRelativeUrl: string = `${encodeURIComponent(relativeLibOrListUrl)}/${encodeURIComponent(folderPath)}`;

return `${remoteSiteUrl}/_api/web/GetFolderByServerRelativeUrl(@folderByServerRelativeUrl)/ListItemAllFields/EffectiveBasePermissions?@folderByServerRelativeUrl='${folderByServerRelativeUrl}'`;
}
// Check permission on the list or library.
else {
return `${remoteSiteUrl}/_api/web/GetList(@listUrl)/EffectiveBasePermissions?@listUrl='${encodeURIComponent(relativeLibOrListUrl)}'`;
}
}

/**
* Default React render method
*/