Skip to content
Snippets Groups Projects
Unverified Commit 162a5edd authored by vmaubert's avatar vmaubert Committed by GitHub
Browse files

fix(activités): donne les droits de consultation à la préfecture de Guyane (#651)

parent db375c5d
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,22 @@ test.each<[User, boolean]>([
},
false,
],
[
{
...testBlankUser,
role: 'admin',
administrationId: ADMINISTRATION_IDS['PRÉFECTURE - GUYANE'],
},
true,
],
[
{
...testBlankUser,
role: 'admin',
administrationId: ADMINISTRATION_IDS['PRÉFECTURE - ARDÈCHE'],
},
false,
],
[
{
...testBlankUser,
......
import { isAdministration, isEntreprise, isSuper, User } from '../roles.js'
import { Administrations, ADMINISTRATION_TYPE_IDS } from '../static/administrations.js'
import { Administrations, ADMINISTRATION_TYPE_IDS, ADMINISTRATION_IDS } from '../static/administrations.js'
export const canReadActivites = (user: User) =>
isSuper(user) ||
isEntreprise(user) ||
(isAdministration(user) && [ADMINISTRATION_TYPE_IDS.MINISTERE, ADMINISTRATION_TYPE_IDS.DEAL, ADMINISTRATION_TYPE_IDS.DREAL].includes(Administrations[user.administrationId].typeId))
(isAdministration(user) &&
([ADMINISTRATION_TYPE_IDS.MINISTERE, ADMINISTRATION_TYPE_IDS.DEAL, ADMINISTRATION_TYPE_IDS.DREAL].includes(Administrations[user.administrationId].typeId) ||
user.administrationId === ADMINISTRATION_IDS['PRÉFECTURE - GUYANE']))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment