X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..fddd732457ef4b8955fefa105f7e95ba192b705b:/projects/stargazer/plugins/authorization/ao/ao.h diff --git a/projects/stargazer/plugins/authorization/ao/ao.h b/projects/stargazer/plugins/authorization/ao/ao.h index f2912d14..2a9ff3e0 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.h +++ b/projects/stargazer/plugins/authorization/ao/ao.h @@ -45,28 +45,30 @@ template class CHG_BEFORE_NOTIFIER: public PROPERTY_NOTIFIER_BASE { public: + CHG_BEFORE_NOTIFIER(AUTH_AO & a, user_iter u) : user(u), auth(a) {} void Notify(const varParamType & oldValue, const varParamType & newValue); - void SetUser(user_iter u) { user = u; } + //void SetUser(user_iter u) { user = u; } user_iter GetUser() {return user; } - void SetAuthorizator(const AUTH_AO * a) { auth = a; } + //void SetAuthorizator(const AUTH_AO * a) { auth = a; } private: user_iter user; - const AUTH_AO * auth; + const AUTH_AO & auth; }; //----------------------------------------------------------------------------- template class CHG_AFTER_NOTIFIER: public PROPERTY_NOTIFIER_BASE { public: + CHG_AFTER_NOTIFIER(AUTH_AO & a, user_iter u) : user(u), auth(a) {} void Notify(const varParamType & oldValue, const varParamType & newValue); - void SetUser(user_iter u) { user = u; } + //void SetUser(user_iter u) { user = u; } user_iter GetUser() {return user; } - void SetAuthorizator(const AUTH_AO * a) { auth = a; } + //void SetAuthorizator(const AUTH_AO * a) { auth = a; } private: user_iter user; - const AUTH_AO * auth; + const AUTH_AO & auth; }; //----------------------------------------------------------------------------- class AUTH_AO_SETTINGS @@ -136,33 +138,33 @@ private: class ADD_USER_NONIFIER: public NOTIFIER_BASE { public: - ADD_USER_NONIFIER(){}; + ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {}; virtual ~ADD_USER_NONIFIER(){}; - void SetAuthorizator(AUTH_AO * a) { auth = a; } + //void SetAuthorizator(AUTH_AO * a) { auth = a; } void Notify(const user_iter & user) { - auth->AddUser(user); + auth.AddUser(user); } private: - AUTH_AO * auth; + AUTH_AO & auth; } onAddUserNotifier; class DEL_USER_NONIFIER: public NOTIFIER_BASE { public: - DEL_USER_NONIFIER(){}; + DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}; virtual ~DEL_USER_NONIFIER(){}; - void SetAuthorizator(AUTH_AO * a) { auth = a; } + //void SetAuthorizator(AUTH_AO * a) { auth = a; } void Notify(const user_iter & user) { - auth->DelUser(user); + auth.DelUser(user); } private: - AUTH_AO * auth; + AUTH_AO & auth; } onDelUserNotifier; };