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

SharePoint "Full kontroll" tilgangsnivå rettighetssjekk #1055

Merged
merged 7 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Sjekk ut [release notes](./releasenotes/1.8.0.md) for høydepunkter og mer detal

### Forbedringer

- Dersom bruker har "Full kontroll" tilgangsnivå på området får bruker fulle rettigheter på området [#1054](https://github.com/Puzzlepart/prosjektportalen365/issues/1054)

### Feilrettinger

- Fikset et problem i oppgraderingsskript der noen tenants ikke kunne hente alle hub children
Expand Down
4 changes: 2 additions & 2 deletions SharePointFramework/@Shared/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions SharePointFramework/@Shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pp365-shared",
"version": "1.8.0",
"version": "1.8.0-1055.1",
"repository": {
"type": "git",
"url": "https://github.com/Puzzlepart/prosjektportalen365.git",
Expand Down Expand Up @@ -67,4 +67,4 @@
"prettier": "^2.1.1",
"typescript": "4.5.5"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SPUser } from '@microsoft/sp-page-context'
import { WebPartContext } from '@microsoft/sp-webpart-base'
import { dateAdd, PnPClientStorage, PnPClientStore } from '@pnp/common'
import '@pnp/polyfill-ie11'
import { sp, SPConfiguration, SPRest, Web } from '@pnp/sp'
import { sp, SPConfiguration, SPRest, Web, PermissionKind } from '@pnp/sp'
import { format } from 'office-ui-fabric-react/lib/Utilities'
import { SpEntityPortalService } from 'sp-entityportal-service'
import _ from 'underscore'
Expand Down Expand Up @@ -116,8 +116,8 @@ export class SPDataAdapterBase<T extends ISPDataAdapterBaseConfiguration> {
const userPermissions = []
const rolesToCheck = properties.GtProjectAdminRoles
if (!_.isArray(rolesToCheck) || _.isEmpty(rolesToCheck)) {
olemp marked this conversation as resolved.
Show resolved Hide resolved
if (pageContext.legacyPageContext.isSiteAdmin === true) return true
else return false
const currentUserHasManageWebPermisson = await sp.web.currentUserHasPermissions(PermissionKind.ManageWeb)
if (currentUserHasManageWebPermisson) return true
}
const currentUser = await this.getCurrentUser(pageContext.user)
const projectAdminRoles = (await this.portal.getProjectAdminRoles()).filter(
Expand All @@ -128,7 +128,8 @@ export class SPDataAdapterBase<T extends ISPDataAdapterBaseConfiguration> {
switch (role.type) {
case ProjectAdminRoleType.SiteAdmin:
{
if (pageContext.legacyPageContext.isSiteAdmin === true)
const currentUserHasManageWebPermisson = await sp.web.currentUserHasPermissions(PermissionKind.ManageWeb)
Remi749 marked this conversation as resolved.
Show resolved Hide resolved
if (currentUserHasManageWebPermisson)
userPermissions.push(...role.permissions)
}
break
Expand Down Expand Up @@ -165,7 +166,7 @@ export class SPDataAdapterBase<T extends ISPDataAdapterBaseConfiguration> {
).length > 0
)
userPermissions.push(...role.permissions)
} catch {}
} catch { }
}
break
}
Expand Down
Loading