// // Created by WolverinDEV on 26/02/2021. // #include "./InstanceHandler.h" #include "./groups/GroupManager.h" #include "./PermissionCalculator.h" using namespace ts; using namespace ts::server; permission::v2::PermissionFlaggedValue InstancePermissionHelper::calculate_permission( permission::PermissionType permission, ClientDbId cldbid, ClientType type, ChannelId channel, bool granted, std::shared_ptr cache ) const { auto result = this->calculate_permissions({permission}, cldbid, type, channel, granted, cache); if(result.empty()) return {0, false}; return result.front().second; } std::vector > InstancePermissionHelper::calculate_permissions( const std::deque &permissions, ClientDbId cldbid, ClientType type, ChannelId channel, bool granted, std::shared_ptr /* cache */ ) const { ClientPermissionCalculator calculator{nullptr, cldbid, type, channel}; return calculator.calculate_permissions(permissions, granted); }