Ajout des permissions explicites dans les employés

This commit is contained in:
FyloZ 2021-03-15 19:30:02 -04:00
parent af9c7ca092
commit ae88dac1bf
1 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ data class Employee(
@CollectionTable(name = "employee_permission", joinColumns = [JoinColumn(name = "employee_id")])
@Column(name = "permission")
@Fetch(FetchMode.SUBSELECT)
@get:JsonIgnore
@get:JsonProperty("explicitPermissions")
val permissions: MutableSet<EmployeePermission> = mutableSetOf(),
@Column(name = "last_login_time")
@ -147,7 +147,7 @@ data class EmployeeGroup(
val employees: MutableSet<Employee> = mutableSetOf()
) : NamedModel {
@JsonProperty("employeeCount")
fun getEmployeeCount() = employees.size
fun getEmployeeCount() = employees.size - 1 // Remove the default employee
override fun equals(other: Any?): Boolean = other is EmployeeGroup && id == other.id && name == other.name
override fun hashCode(): Int = Objects.hash(id, name)