Skip to content

Commit

Permalink
Merge pull request #161 from xmtp/cv/metadata-policy
Browse files Browse the repository at this point in the history
feat: adds a metadata specific permission policy
  • Loading branch information
cameronvoell authored Apr 19, 2024
2 parents 4b03702 + 64b0d1e commit 06a5f87
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion proto/mls/message_contents/group_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum ConversationType {
message PolicySet {
MembershipPolicy add_member_policy = 1;
MembershipPolicy remove_member_policy = 2;
MembershipPolicy update_group_name_policy = 3;
MetadataPolicy update_group_name_policy = 3;
}

// A policy that governs adding/removing members or installations
Expand Down Expand Up @@ -53,3 +53,30 @@ message MembershipPolicy {
AnyCondition any_condition = 3;
}
}

// A policy that governs updating metadata
message MetadataPolicy {
// Base policy
enum MetadataBasePolicy {
METADATA_BASE_POLICY_UNSPECIFIED = 0;
METADATA_BASE_POLICY_ALLOW = 1;
METADATA_BASE_POLICY_DENY = 2;
METADATA_BASE_POLICY_ALLOW_IF_ACTOR_CREATOR = 3;
}

// Combine multiple policies. All must evaluate to true
message AndCondition {
repeated MetadataPolicy policies = 1;
}

// Combine multiple policies. Any must evaluate to true
message AnyCondition {
repeated MetadataPolicy policies = 1;
}

oneof kind {
MetadataBasePolicy base = 1;
AndCondition and_condition = 2;
AnyCondition any_condition = 3;
}
}

0 comments on commit 06a5f87

Please sign in to comment.