Skip to content

Commit

Permalink
Fix for #1549
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed Aug 5, 2024
1 parent 5583fa6 commit 70f8b3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci-channel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
build_release_package_test:
name: Build release package (test channel)
runs-on: macos-latest
concurrency:
group: ${{ github.ref }}_build_release_package_for_test_channel
cancel-in-progress: true
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') && !contains(github.event.head_commit.message, '[packages-only]') }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -78,9 +75,6 @@ jobs:
build_release_package_test_packages_only:
name: Build release package - packages only (test channel)
runs-on: macos-latest
concurrency:
group: ${{ github.ref }}_build_release_package_for_test_channel_packages_only
cancel-in-progress: true
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') || contains(github.event.head_commit.message, '[packages-only]')}}
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Sjekk ut [release notes](./releasenotes/1.9.0.md) for høydepunkter og mer detal
- Rettet et problem hvor planneroppgaver ikke ble provisjonert i riktig rekkefølge [#1530](https://github.com/Puzzlepart/prosjektportalen365/issues/1530)
- Rettet et problem med eksport til Excel for aggregerte oversikter [#1519](https://github.com/Puzzlepart/prosjektportalen365/issues/1519)
- Rettet et problem med visningskolonner i aggregerte oversikter [#1447](https://github.com/Puzzlepart/prosjektportalen365/issues/1447)
- Rettet et problem hvor tillatelseskonfigurasjon feilet dersom man ikke er eier på hub [#1549](https://github.com/Puzzlepart/prosjektportalen365/issues/1549)

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ export class SitePermissions extends BaseTask {
): Promise<IBaseTaskParams> {
try {
onProgress(strings.SitePermissionsText, strings.SitePermissionsSubText, 'Permissions')
const [permConfig, roleDefinitions, groups] = await Promise.all([
const [permConfig, roleDefinitions] = await Promise.all([
this._getPermissionConfiguration(),
this._getRoleDefinitions(params.web),
this._getSiteGroups()
this._getRoleDefinitions(params.web)
])

for (let i = 0; i < permConfig.length; i++) {
const { groupName, permissionLevel } = permConfig[i]
const users = groups[groupName] || []
const siteGroup = await this._getSiteGroupByName(groupName)

const users = siteGroup || []
if (isEmpty(users)) continue
const roleDefId = roleDefinitions[permissionLevel]
if (roleDefId) {
Expand Down Expand Up @@ -122,6 +123,17 @@ export class SitePermissions extends BaseTask {
)
}

/**
* Get site group by name with users from the portal web
*/
private async _getSiteGroupByName(groupName: string) {
const group = await SPDataAdapter.portalDataService.web.siteGroups
.getByName(groupName)
.select('Title', 'Users')
.expand('Users')()
return group['Users'] && group['Users'].map((u: ISiteUserProps) => u.LoginName)
}

/**
* Get role definitions for the specified web
*
Expand Down

0 comments on commit 70f8b3d

Please sign in to comment.