Files
Dušan Borovčanin ef5c253c51 SMQ-3399 - Unify Magistrala and SuperMQ (#3400)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
Co-authored-by: Steve Munene <stevenyaga2014@gmail.com>
2026-04-01 09:55:11 +02:00

68 lines
1.6 KiB
Go

// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package policies
import (
"context"
)
const (
GroupsKind = "groups"
NewGroupKind = "new_group"
ChannelsKind = "channels"
NewChannelKind = "new_channel"
ClientsKind = "clients"
NewClientKind = "new_client"
UsersKind = "users"
DomainsKind = "domains"
PlatformKind = "platform"
)
const (
RoleType = "role"
GroupType = "group"
ClientType = "client"
ChannelType = "channel"
UserType = "user"
DomainType = "domain"
PlatformType = "platform"
RulesType = "rules"
ReportsType = "reports"
AlarmsType = "alarms"
)
const (
AdministratorRelation = "administrator"
EditorRelation = "editor"
ContributorRelation = "contributor"
MemberRelation = "member"
DomainRelation = "domain"
ParentGroupRelation = "parent_group"
RoleGroupRelation = "role_group"
GroupRelation = "group"
PlatformRelation = "platform"
GuestRelation = "guest"
)
const (
AdminPermission = "admin"
DeletePermission = "delete"
EditPermission = "edit"
ViewPermission = "view"
MembershipPermission = "membership"
SharePermission = "share"
PublishPermission = "publish"
SubscribePermission = "subscribe"
CreatePermission = "create"
)
const MagistralaObject = "magistrala"
type Evaluator interface {
// CheckPolicy checks if the subject has a relation on the object.
// It returns a non-nil error if the subject has no relation on
// the object (which simply means the operation is denied).
CheckPolicy(ctx context.Context, pr Policy) error
}