#29 Implement Workgroup members routes (Add, remove, update)
This commit is contained in:
@@ -43,10 +43,9 @@ open class WorkgroupRef(
|
||||
id: UUID?
|
||||
) : UuidEntity(id ?: UUID.randomUUID()), WorkgroupI
|
||||
|
||||
interface WorkgroupWithAuthI<Z : CitizenWithUserI> : WorkgroupI, EntityCreatedBy<Z>, EntityDeletedAt {
|
||||
interface WorkgroupWithAuthI<Z : CitizenWithUserI> : WorkgroupWithMembersI<Z>, EntityCreatedBy<Z>, EntityDeletedAt {
|
||||
val anonymous: Boolean
|
||||
val owner: Z
|
||||
var members: List<Z>
|
||||
|
||||
fun isMember(user: UserI): Boolean =
|
||||
members.map { it.user.id }.contains(user.id) || owner.user.id == user.id
|
||||
@@ -55,4 +54,8 @@ interface WorkgroupWithAuthI<Z : CitizenWithUserI> : WorkgroupI, EntityCreatedBy
|
||||
isMember(citizen.user)
|
||||
}
|
||||
|
||||
interface WorkgroupWithMembersI<Z : CitizenI> : WorkgroupI {
|
||||
var members: List<Z>
|
||||
}
|
||||
|
||||
interface WorkgroupI : UuidEntityI
|
||||
Reference in New Issue
Block a user