Ajout des permissions

This commit is contained in:
FyloZ 2020-12-27 15:51:28 -05:00
parent 6bd111a5e9
commit 4b5dec39d8
2 changed files with 13 additions and 1 deletions

View File

@ -269,6 +269,12 @@ private enum class ControllerAuthorizations(
HttpMethod.PUT to EmployeePermission.EDIT_MATERIAL_TYPE,
HttpMethod.DELETE to EmployeePermission.REMOVE_MATERIAL_TYPE
)),
COMPANY("/api/company/**", mapOf(
HttpMethod.GET to EmployeePermission.VIEW_COMPANY,
HttpMethod.POST to EmployeePermission.EDIT_COMPANY,
HttpMethod.PUT to EmployeePermission.EDIT_COMPANY,
HttpMethod.DELETE to EmployeePermission.REMOVE_COMPANY
)),
SET_BROWSER_DEFAULT_GROUP("/api/employee/group/default/**", mapOf(
HttpMethod.GET to EmployeePermission.VIEW_EMPLOYEE_GROUP,
HttpMethod.POST to EmployeePermission.SET_BROWSER_DEFAULT_GROUP

View File

@ -165,9 +165,11 @@ enum class EmployeePermission(val impliedPermissions: List<EmployeePermission> =
// View
VIEW_MATERIAL,
VIEW_MATERIAL_TYPE,
VIEW_COMPANY,
VIEW(listOf(
VIEW_MATERIAL,
VIEW_MATERIAL_TYPE
VIEW_MATERIAL_TYPE,
VIEW_COMPANY
)),
VIEW_EMPLOYEE,
VIEW_EMPLOYEE_GROUP,
@ -175,9 +177,11 @@ enum class EmployeePermission(val impliedPermissions: List<EmployeePermission> =
// Edit
EDIT_MATERIAL(listOf(VIEW_MATERIAL)),
EDIT_MATERIAL_TYPE(listOf(VIEW_MATERIAL_TYPE)),
EDIT_COMPANY(listOf(VIEW_COMPANY)),
EDIT(listOf(
EDIT_MATERIAL,
EDIT_MATERIAL_TYPE,
EDIT_COMPANY,
VIEW
)),
EDIT_EMPLOYEE(listOf(VIEW_EMPLOYEE)),
@ -187,9 +191,11 @@ enum class EmployeePermission(val impliedPermissions: List<EmployeePermission> =
// Remove
REMOVE_MATERIAL(listOf(EDIT_MATERIAL)),
REMOVE_MATERIAL_TYPE(listOf(EDIT_MATERIAL_TYPE)),
REMOVE_COMPANY(listOf(EDIT_COMPANY)),
REMOVE(listOf(
REMOVE_MATERIAL,
REMOVE_MATERIAL_TYPE,
REMOVE_COMPANY,
EDIT
)),
REMOVE_EMPLOYEE(listOf(EDIT_EMPLOYEE)),