First Cut of Enhanced Permissions #543

Merged
sarah merged 4 commits from enhanced-permissions into master 2024-01-15 18:04:35 +00:00
1 changed files with 6 additions and 4 deletions
Showing only changes of commit b0a87ee8d0 - Show all commits

View File

@ -313,12 +313,14 @@ func (cp *cwtchPeer) GenerateProtocolEngine(acn connectivity.ACN, bus event.Mana
if tor.IsValidHostname(conversation.Handle) {
dan marked this conversation as resolved
Review

Add comment calling this section upgrading attributes v0 to v1

Add comment calling this section upgrading attributes v0 to v1
// if this profile does not have an ACL version, and the profile is accepted, then migrate
// the permissions to the v1 ACL
// migrate the old accepted AC to a new fine-grained one
// we only do this for previously trusted connections
// NOTE: this does not supercede global cwthch experiments settings
// if share files is turned off globally then acl.ShareFiles will be ignored.
if _, exists := conversation.GetAttribute(attr.LocalScope, attr.ProfileZone, constants.ACLVersion); !exists {
if conversation.Accepted {
// migrate the old accepted AC to a new fine-grained one
// we only do this for previously trusted connections
// NOTE: this does not supercede global cwthch experiments settings
// if share files is turned off globally then acl.ShareFiles will be ignored.
if ac, exists := conversation.ACL[conversation.Handle]; exists {
ac.ShareFiles = true
ac.RenderImages = true