Skip to content
Snippets Groups Projects
Commit f1451e8a authored by michael.minelli's avatar michael.minelli
Browse files

SecurityCheck => Add enonce published test

parent 7ca82fad
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,9 @@ class SecurityMiddleware { ...@@ -28,6 +28,9 @@ class SecurityMiddleware {
case SecurityCheckType.ENONCE_STAFF: case SecurityCheckType.ENONCE_STAFF:
isAllowed = isAllowed || await EnonceManager.isUserAllowedToAccessEnonce(req.boundParams.enonce, req.session.profile); isAllowed = isAllowed || await EnonceManager.isUserAllowedToAccessEnonce(req.boundParams.enonce, req.session.profile);
break; break;
case SecurityCheckType.ENONCE_IS_PUBLISHED:
isAllowed = isAllowed || req.boundParams.enonce.published;
break;
default: default:
isAllowed = isAllowed || false; isAllowed = isAllowed || false;
break; break;
......
enum SecurityCheckType { enum SecurityCheckType {
TEACHING_STAFF = 'teachingStaff', TEACHING_STAFF = 'teachingStaff',
ENONCE_STAFF = 'enonceStaff' ENONCE_STAFF = 'enonceStaff',
ENONCE_IS_PUBLISHED = 'enonceIsPublished',
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment