File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,8 @@ const adminGroups = ['grp-ospa']
394394
395395const openUniGroups = [ 'hy-ypa-opa-dojo' ]
396396
397+ const hyOneGroups = [ 'hy-one' ] // opintoasiainneuvosto
398+
397399const employeeGroups = [ 'hy-employees' ]
398400
399401const oodikoneIams = [ 'grp-oodikone-users' , 'grp-oodikone-basic-users' ]
@@ -404,6 +406,8 @@ const isAdminIam = (iam) => adminGroups.includes(iam)
404406
405407const isOpenUniIam = ( iam ) => openUniGroups . includes ( iam )
406408
409+ const isHyOneIam = ( iam ) => hyOneGroups . includes ( iam )
410+
407411const isUniversityWideIam = ( iam ) => universityWideGroups . includes ( iam )
408412
409413const isDoctoralIam = ( iam ) => doctoralIams . includes ( iam )
@@ -451,6 +455,7 @@ const relevantIAMs = []
451455 . concat ( superAdminGroups )
452456 . concat ( adminGroups )
453457 . concat ( openUniGroups )
458+ . concat ( hyOneGroups )
454459 . concat ( employeeGroups )
455460 . concat ( oodikoneIams )
456461
@@ -473,6 +478,7 @@ module.exports = {
473478 isSuperAdminIam,
474479 isAdminIam,
475480 isOpenUniIam,
481+ isHyOneIam,
476482 isUniversityWideIam,
477483 isDoctoralIam,
478484 isEmployeeIam,
Original file line number Diff line number Diff line change 22 isSuperAdminIam,
33 isAdminIam,
44 isOpenUniIam,
5+ isHyOneIam,
56 isUniversityWideIam,
67 isDoctoralIam,
78 iamToOrganisationCode,
@@ -75,6 +76,24 @@ const getOpenUni = (hyGroups) => {
7576 return { }
7677}
7778
79+ /**
80+ * Needed for Oodikone
81+ * Grant teachers rights if the user has correct iams (eg. hy-one)
82+ * @param {string[] } hyGroups
83+ * @returns hyOne special group
84+ */
85+ const getHyOne = ( hyGroups ) => {
86+ console . log ( 'hyOne' )
87+
88+ const isHyIam = hyGroups . some ( isHyOneIam )
89+
90+ console . log ( isHyIam )
91+ if ( isHyIam ) {
92+ return { specialGroup : { hyOne : true } }
93+ }
94+ return { }
95+ }
96+
7897/**
7998 * Grant reading rights to all programmes if user has uni wide IAM (eg. hy-rehtoraatti)
8099 * @param {string[] } hyGroups
@@ -253,6 +272,7 @@ const getIAMRights = (hyGroups) => {
253272 getAdmin ,
254273 getSuperAdmin ,
255274 getOpenUni ,
275+ getHyOne ,
256276 ]
257277 . map ( ( f ) => f ( hyGroups ) )
258278 . forEach ( ( { access : newAccess , specialGroup : newSpecialGroup } ) => {
You can’t perform that action at this time.
0 commit comments