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

feat(clientapi): Change signature of function to update user's system admin membership #1583

Merged
merged 2 commits into from Feb 5, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -41,7 +41,7 @@ import scala.concurrent.{ExecutionContext, Future}


object GroupsRouteADM {
val GroupsBasePath = PathMatcher("admin" / "groups")
val GroupsBasePath: PathMatcher[Unit] = PathMatcher("admin" / "groups")
val GroupsBasePathString: String = "/admin/groups"
}

Expand Down
Expand Up @@ -49,7 +49,7 @@ import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try

object ProjectsRouteADM {
val ProjectsBasePath = PathMatcher("admin" / "projects")
val ProjectsBasePath: PathMatcher[Unit] = PathMatcher("admin" / "projects")
val ProjectsBasePathString = "/admin/projects"
}

Expand Down Expand Up @@ -82,7 +82,6 @@ class ProjectsRouteADM(routeData: KnoraRouteData) extends KnoraRoute(routeData)
// Classes used in client function definitions.

private val Project = classRef(OntologyConstants.KnoraAdminV2.ProjectClass.toSmartIri)
private val StoredProject = Project.toStoredClassRef
private val ProjectsResponse = classRef(OntologyConstants.KnoraAdminV2.ProjectsResponse.toSmartIri)
private val ProjectResponse = classRef(OntologyConstants.KnoraAdminV2.ProjectResponse.toSmartIri)
private val UpdateProjectRequest = classRef(OntologyConstants.KnoraAdminV2.UpdateProjectRequest.toSmartIri)
Expand Down
Expand Up @@ -44,7 +44,7 @@ import scala.concurrent.{ExecutionContext, Future}


object UsersRouteADM {
val UsersBasePath = PathMatcher("admin" / "users")
val UsersBasePath: PathMatcher[Unit] = PathMatcher("admin" / "users")
val UsersBasePathString: String = "/admin/users"
}

Expand Down Expand Up @@ -85,7 +85,6 @@ class UsersRouteADM(routeData: KnoraRouteData) extends KnoraRoute(routeData) wit
private val GroupsResponse = classRef(OntologyConstants.KnoraAdminV2.GroupsResponse.toSmartIri)
private val User = classRef(OntologyConstants.KnoraAdminV2.UserClass.toSmartIri)
private val UpdateUserRequest = classRef(OntologyConstants.KnoraAdminV2.UpdateUserRequest.toSmartIri)
private val StoredUser = User.toStoredClassRef

private val anythingUser1IriEnc = URLEncoder.encode(SharedTestDataADM.anythingUser1.id, "UTF-8")
private val multiUserIriEnc = URLEncoder.encode(SharedTestDataADM.multiuserUser.id, "UTF-8")
Expand Down Expand Up @@ -554,11 +553,12 @@ class UsersRouteADM(routeData: KnoraRouteData) extends KnoraRoute(routeData) wit

private val updateUserSystemAdminMembershipFunction: ClientFunction =
"updateUserSystemAdminMembership" description "Updates a user's SystemAdmin membership." params (
"user" description "The user to be updated." paramType StoredUser
"iri" description "The IRI of the user to be updated." paramType UriDatatype,
"systemAdmin" description "True if the user should be a system admin" paramType BooleanDatatype
) doThis {
httpPut(
path = str("iri") / argMember("user", "id") / str("SystemAdmin"),
body = Some(json("systemAdmin" -> argMember("user", "systemAdmin")))
path = str("iri") / arg("iri") / str("SystemAdmin"),
body = Some(json("systemAdmin" -> arg("systemAdmin")))
)
} returns UserResponse

Expand Down