mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* [MM-61756] Attribute Based Access Control - Phase 1 (#30785)
Attribute Based Access Control - Base
* MM-63662
* MM-63919
* MM-63954
* MM-63955
* MM-63425
* MM-63426
* MM-63458
* MM-63459
* MM-63603
* MM-63845
* MM-64146
* MM-64199
* MM-64201
* MM-64233
* MM-64247
* MM-64268
---------
Co-authored-by: Harshil Sharma <[email protected]>
Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]>
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
(cherry picked from commit 4a5e5b4d87)
* trigger CI
---------
Co-authored-by: Ibrahim Serdar Acikgoz <[email protected]>
Co-authored-by: Harshil Sharma <[email protected]>
Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]>
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package model
|
|
|
|
// ValueType indicates whether a value is a literal or another attribute.
|
|
type ValueType int
|
|
|
|
const (
|
|
LiteralValue ValueType = iota
|
|
AttrValue
|
|
)
|
|
|
|
// Condition represents a single logical condition (e.g., user.attributes.Team == "Engineering").
|
|
type Condition struct {
|
|
// Left-hand side attribute selector (e.g., "user.attributes.Team").
|
|
Attribute string `json:"attribute"`
|
|
// The comparison operator.
|
|
Operator string `json:"operator"`
|
|
// Right-hand side value(s). Can be a single value or a slice for 'in'.
|
|
Value any `json:"value"`
|
|
// Type of the Value (LiteralValue or AttributeValue). Needed for comparisons like user.attr1 == user.attr2.
|
|
ValueType ValueType `json:"value_type"`
|
|
}
|
|
|
|
// VisualExpression represents a series of conditions combined with logical AND.
|
|
type VisualExpression struct {
|
|
// Conditions is a list of individual conditions that will be ANDed together.
|
|
Conditions []Condition `json:"conditions"`
|
|
}
|