Add host-configurable collab permissions with layered overrides.
All checks were successful
Windows Release / windows-x86_64 (push) Successful in 1h12m54s
All checks were successful
Windows Release / windows-x86_64 (push) Successful in 1h12m54s
Session/person/layer defaults plus person×layer ACL (Allow/Deny/Inherit) for draw, move, delete, hide, and layer management; bump save format to 0.9.0-fork. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2009a3f892
commit
7f34283537
20 changed files with 715 additions and 70 deletions
|
|
@ -20,10 +20,12 @@
|
|||
#include <Helpers/NetworkingObjects/NetObjManager.hpp>
|
||||
#include <Helpers/NetworkingObjects/NetObjOrderedList.hpp>
|
||||
#include <Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.hpp>
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include "DrawingProgramLayerFolder.hpp"
|
||||
#include "DrawingProgramLayer.hpp"
|
||||
#include "SerializedBlendMode.hpp"
|
||||
#include "../../CollabPermissions.hpp"
|
||||
#include "../../CanvasComponents/CanvasComponentContainer.hpp"
|
||||
|
||||
class DrawingProgramLayerFolder;
|
||||
|
|
@ -89,6 +91,14 @@ class DrawingProgramLayerListItem {
|
|||
// Fog layers are always treated as player-locked for edit checks.
|
||||
bool is_player_edit_blocked() const;
|
||||
|
||||
const CollabPermissionSet& get_layer_defaults() const;
|
||||
void set_layer_defaults(DrawingProgramLayerManager& layerMan, const CollabPermissionSet& defaults) const;
|
||||
const std::map<std::string, CollabPermissionSet>& get_person_layer_overrides() const;
|
||||
void set_person_layer_override(DrawingProgramLayerManager& layerMan, const std::string& displayName, const CollabPermissionSet& overrides) const;
|
||||
void clear_person_layer_override(DrawingProgramLayerManager& layerMan, const std::string& displayName) const;
|
||||
/** Apply session new-layer defaults (call after create). */
|
||||
void apply_new_layer_permission_defaults(DrawingProgramLayerManager& layerMan) const;
|
||||
|
||||
void set_metainfo(DrawingProgramLayerManager& layerMan, const DrawingProgramLayerListItemMetaInfo& metaInfo);
|
||||
DrawingProgramLayerListItemMetaInfo get_metainfo() const;
|
||||
|
||||
|
|
@ -115,9 +125,13 @@ class DrawingProgramLayerListItem {
|
|||
SerializedBlendMode blendMode = SerializedBlendMode::BLEND_SRC_OVER;
|
||||
bool playerLocked = false;
|
||||
bool fogLayer = false;
|
||||
CollabPermissionSet layerDefaults = CollabPermissionSet::all_inherit();
|
||||
std::map<std::string, CollabPermissionSet> personOverrides;
|
||||
template <typename Archive> void serialize(Archive& a) {
|
||||
a(alpha, visible, blendMode, playerLocked, fogLayer);
|
||||
a(alpha, visible, blendMode, playerLocked, fogLayer, layerDefaults, personOverrides);
|
||||
}
|
||||
void migrate_player_locked_into_defaults();
|
||||
void sync_player_locked_from_defaults();
|
||||
};
|
||||
NetworkingObjects::NetObjOwnerPtr<NameData> nameData;
|
||||
NetworkingObjects::NetObjOwnerPtr<DisplayData> displayData;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue