Skip to content

Commit

Permalink
chore: Change default DOAPs according to the defined requirements (DE…
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt authored Aug 26, 2024
1 parent c7e9451 commit 0adfeee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/03-endpoints/api-admin/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ When a new project is created, following default permissions are added to its ad
This administrative permission is retrievable through its IRI:
`http://rdfh.ch/permissions/[projectShortcode]/defaultApForMember`

- ProjectMember group also gets a default object access permission to modify
(which includes view and restricted view permissions) of any entity that belongs to the project.
- ProjectMember group also gets a default object access permission to delete
(which includes modify, view and restricted view permissions) of any entity that belongs to the project.
This default object access permission is retrievable through its IRI:
`http://rdfh.ch/permissions/[projectShortcode]/defaultDoapForMember`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class ProjectRestServiceSpec extends CoreSpec with ImplicitSender {
doap.hasPermissions.equals(
Set(
PermissionADM.from(Permission.ObjectAccess.ChangeRights, KnoraGroupRepo.builtIn.ProjectAdmin.id.value),
PermissionADM.from(Permission.ObjectAccess.Modify, KnoraGroupRepo.builtIn.ProjectMember.id.value),
PermissionADM.from(Permission.ObjectAccess.Delete, KnoraGroupRepo.builtIn.ProjectMember.id.value),
),
)
}
Expand All @@ -235,7 +235,7 @@ class ProjectRestServiceSpec extends CoreSpec with ImplicitSender {
doap.hasPermissions.equals(
Set(
PermissionADM.from(Permission.ObjectAccess.ChangeRights, KnoraGroupRepo.builtIn.ProjectAdmin.id.value),
PermissionADM.from(Permission.ObjectAccess.Modify, KnoraGroupRepo.builtIn.ProjectMember.id.value),
PermissionADM.from(Permission.ObjectAccess.Delete, KnoraGroupRepo.builtIn.ProjectMember.id.value),
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1719,30 +1719,28 @@ final case class PermissionsResponder(
UUID.randomUUID(),
)

// Give the admins of the new project rights to change rights, modify, delete, view,
// and restricted view of all resources and values that belong to the project.
// Create default object access permissions for SystemAdmin of the new project
_ <- createDefaultObjectAccessPermission(
CreateDefaultObjectAccessPermissionAPIRequestADM(
forProject = projectIri.value,
forGroup = Some(builtIn.ProjectAdmin.id.value),
hasPermissions = Set(
PermissionADM.from(Permission.ObjectAccess.ChangeRights, builtIn.ProjectAdmin.id.value),
PermissionADM.from(Permission.ObjectAccess.Modify, builtIn.ProjectMember.id.value),
PermissionADM.from(Permission.ObjectAccess.Delete, builtIn.ProjectMember.id.value),
),
),
KnoraSystemInstances.Users.SystemUser,
UUID.randomUUID(),
)

// Give the members of the new project rights to modify, view, and restricted view of all resources and values
// that belong to the project.
// Create default object access permissions for ProjectAdmin of the new project
_ <- createDefaultObjectAccessPermission(
CreateDefaultObjectAccessPermissionAPIRequestADM(
forProject = projectIri.value,
forGroup = Some(builtIn.ProjectMember.id.value),
hasPermissions = Set(
PermissionADM.from(Permission.ObjectAccess.ChangeRights, builtIn.ProjectAdmin.id.value),
PermissionADM.from(Permission.ObjectAccess.Modify, builtIn.ProjectMember.id.value),
PermissionADM.from(Permission.ObjectAccess.Delete, builtIn.ProjectMember.id.value),
),
),
KnoraSystemInstances.Users.SystemUser,
Expand Down

0 comments on commit 0adfeee

Please sign in to comment.