# HG changeset patch # User Sebastien Jodogne # Date 1788439769 -7200 # Node ID be0aa2c9d0b1cc036bf300d4c016b1e981b5e54c # Parent 2556d9fd27c650140db0c0b6b3b444fad262d654 creating learners diff -r 2556d9fd27c6 -r be0aa2c9d0b1 ViewerPlugin/Annotations/IAuthenticatedUser.cpp --- a/ViewerPlugin/Annotations/IAuthenticatedUser.cpp Thu Sep 03 14:29:13 2026 +0200 +++ b/ViewerPlugin/Annotations/IAuthenticatedUser.cpp Thu Sep 03 14:49:29 2026 +0200 @@ -83,7 +83,7 @@ }; - class EducationPluginAuthenticatedUser : public IAuthenticatedUser + class EducationPluginUser : public IAuthenticatedUser { public: enum EducationRole @@ -100,7 +100,7 @@ std::set learnerOfProjects_; public: - explicit EducationPluginAuthenticatedUser(const Json::Value& authentication) + explicit EducationPluginUser(const Json::Value& authentication) { assert(Orthanc::SerializationToolbox::ReadString(authentication, "source") == "orthanc-education"); @@ -184,13 +184,16 @@ }; - class GenericInstructor : public IAuthenticatedUser + class GenericStandardUser : public IAuthenticatedUser { private: + ProjectRole role_; std::string username_; public: - explicit GenericInstructor(const std::string& username) : + GenericStandardUser(ProjectRole role, + const std::string& username) : + role_(role), username_(username) { } @@ -207,7 +210,7 @@ virtual ProjectRole GetRoleInProject(const std::string& projectId) const ORTHANC_OVERRIDE { - return ProjectRole_Instructor; + return role_; } }; } @@ -234,7 +237,8 @@ if (!tokens.empty() && !tokens[0].empty()) { - return new GenericInstructor(tokens[0]); + //return new GenericStandardUser(IAuthenticatedUser::ProjectRole_Instructor, tokens[0]); + return new GenericStandardUser(IAuthenticatedUser::ProjectRole_Learner, tokens[0]); } } } @@ -261,7 +265,7 @@ } else { - return new GenericInstructor(request->headersValues[i]); + return new GenericStandardUser(IAuthenticatedUser::ProjectRole_Instructor, request->headersValues[i]); } } } @@ -293,7 +297,7 @@ if (source == "orthanc-education") { - return new EducationPluginAuthenticatedUser(authentication); + return new EducationPluginUser(authentication); } else {