# HG changeset patch # User Sebastien Jodogne # Date 1787318903 -7200 # Node ID e26bf161c0391434910fe9e2934595a01ce8b7b7 # Parent 971c7c1ca6175ea902f3b080952e66a8fec95cb7 added class IAuthenticatedUser::GenericInstructor diff -r 971c7c1ca617 -r e26bf161c039 ViewerPlugin/Annotations/IAuthenticatedUser.cpp --- a/ViewerPlugin/Annotations/IAuthenticatedUser.cpp Wed Aug 19 15:25:12 2026 +0200 +++ b/ViewerPlugin/Annotations/IAuthenticatedUser.cpp Fri Aug 21 15:28:23 2026 +0200 @@ -177,6 +177,34 @@ } } }; + + + class GenericInstructor : public IAuthenticatedUser + { + private: + std::string username_; + + public: + GenericInstructor(const std::string& username) : + username_(username) + { + } + + virtual UserId GetAnnotatingId() const ORTHANC_OVERRIDE + { + return UserId(UserId::Type_Standard, username_); + } + + virtual std::string Format() const ORTHANC_OVERRIDE + { + return username_; + } + + virtual ProjectRole GetRoleInProject(const std::string& projectId) const ORTHANC_OVERRIDE + { + return ProjectRole_Instructor; + } + }; } @@ -206,6 +234,12 @@ { return new EducationPluginAuthenticatedUser(authentication); } +#if 0 + else if (source == "orthanc-python-sample-authentication") + { + return new GenericInstructor(Orthanc::SerializationToolbox::ReadString(authentication, "username")); + } +#endif } return new GuestUser;