Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Remove permission parsing from spaces. #552

Merged
merged 1 commit into from
Mar 23, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ data class QuotaResponse(
data class RootResponse(
val eTag: String?,
val id: String,
val permissions: List<PermissionResponse>?,
val webDavUrl: String,
val deleted: DeleteResponse?,
)
Expand All @@ -88,38 +87,11 @@ data class FileResponse(
val mimeType: String
)

@JsonClass(generateAdapter = true)
data class IdentityPermissionResponse(
val id: String,
val displayName: String?,
)

@JsonClass(generateAdapter = true)
data class GrantedToIdentitiesResponse(
val user: IdentityPermissionResponse?,
val group: IdentityPermissionResponse?,
)

@JsonClass(generateAdapter = true)
data class DeleteResponse(
val state: String,
)

@JsonClass(generateAdapter = true)
data class PermissionResponse(
val grantedTo: List<GrantedToIdentitiesResponse>?,
val grantedToIdentities: List<GrantedToIdentitiesResponse>?,
val roles: List<String>,
) {
/**
* Supports api renaming from grantedTo to grantedToIdentities on v1.0.1
* https://github.com/owncloud/libre-graph-api/releases/tag/v1.0.1
*/
fun getGrantedToIdentitiesResponse(): List<GrantedToIdentitiesResponse> {
return grantedToIdentities ?: grantedTo ?: throw IllegalArgumentException("Permissions not granted to anyone")
}
}

@JsonClass(generateAdapter = true)
data class SpecialFolderResponse(
val name: String
Expand Down