Loading src/api.cpp +4 −3 Changes for src/api.cpp: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ namespace authdb { public: void checkGPO(json_object *request,json_object *response){ std::lock_guard<std::mutex> lock(AuthSessionLock); json_object *cmd=json_object_object_get(request,"commands"); if(!cmd) throw(AuthBackendError("Invalid Api Commands")); Loading @@ -58,19 +59,19 @@ namespace authdb { json_object_object_foreach(json_object_array_get_idx(cmd,i), key, val) { if(strcmp(key,"checkgpo")==0){ const char *id=json_object_get_string(val); Gpo gpo; GpoData gpdat(id); size_t spos=sizeof(AuthHeader); gpo.info(_Backend,gpdat,spos); GpoData::Allow allow; gpdat.getAlowed(&allow); bool alowed=gpdat.getGpoValue(); gpdat.getAlowed(&allow); for(size_t ii =0; ii<allow.count; ++ii ){ if(uuid(id)==allow.uid[ii]){ if( _SessionData->isMemberOf(allow.uid[ii]) ){ alowed=!alowed; } } Loading src/session.cpp +1 −1 Changes for src/session.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ bool authdb::SessionData::empty() const{ } bool authdb::SessionData::isMemberOf(const uuid& gid){ bool authdb::SessionData::isMemberOf(const uuid& gid) const{ for(const auto &member : _members){ if(member==gid) return true; Loading src/session.h +1 −1 Changes for src/session.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace authdb { class SessionData { public: bool isMemberOf(const uuid &gid); bool isMemberOf(const uuid &gid) const; void getSid(uuid &dest) const; void getUid(uuid &dest) const; Loading Loading
src/api.cpp +4 −3 Changes for src/api.cpp: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ namespace authdb { public: void checkGPO(json_object *request,json_object *response){ std::lock_guard<std::mutex> lock(AuthSessionLock); json_object *cmd=json_object_object_get(request,"commands"); if(!cmd) throw(AuthBackendError("Invalid Api Commands")); Loading @@ -58,19 +59,19 @@ namespace authdb { json_object_object_foreach(json_object_array_get_idx(cmd,i), key, val) { if(strcmp(key,"checkgpo")==0){ const char *id=json_object_get_string(val); Gpo gpo; GpoData gpdat(id); size_t spos=sizeof(AuthHeader); gpo.info(_Backend,gpdat,spos); GpoData::Allow allow; gpdat.getAlowed(&allow); bool alowed=gpdat.getGpoValue(); gpdat.getAlowed(&allow); for(size_t ii =0; ii<allow.count; ++ii ){ if(uuid(id)==allow.uid[ii]){ if( _SessionData->isMemberOf(allow.uid[ii]) ){ alowed=!alowed; } } Loading
src/session.cpp +1 −1 Changes for src/session.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ bool authdb::SessionData::empty() const{ } bool authdb::SessionData::isMemberOf(const uuid& gid){ bool authdb::SessionData::isMemberOf(const uuid& gid) const{ for(const auto &member : _members){ if(member==gid) return true; Loading
src/session.h +1 −1 Changes for src/session.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace authdb { class SessionData { public: bool isMemberOf(const uuid &gid); bool isMemberOf(const uuid &gid) const; void getSid(uuid &dest) const; void getUid(uuid &dest) const; Loading