Files
supermq/re/operations/operations.go
T
Steve Munene 362a4fc76d MG-370 - Add fine grained access control to rules engine (#402)
* update go mod file

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix rules endpoint tests

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix yaml file

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix build

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove roles from alarms

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* change approach for schema combaine

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change approach for schema combaine

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix permissions for rules

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix authorization file

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

---------

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2026-03-05 11:42:51 +01:00

65 lines
1.3 KiB
Go

// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package operations
import (
"github.com/absmach/supermq/pkg/permissions"
)
const EntityType = "rule"
// Rule Operations.
const (
OpAddRule permissions.Operation = iota
OpViewRule
OpUpdateRule
OpUpdateRuleTags
OpUpdateRuleSchedule
OpRemoveRule
OpListRules
OpEnableRule
OpDisableRule
)
func OperationDetails() map[permissions.Operation]permissions.OperationDetails {
return map[permissions.Operation]permissions.OperationDetails{
OpAddRule: {
Name: "add",
PermissionRequired: true,
},
OpViewRule: {
Name: "view",
PermissionRequired: true,
},
OpUpdateRule: {
Name: "update",
PermissionRequired: true,
},
OpUpdateRuleTags: {
Name: "update_tags",
PermissionRequired: true,
},
OpUpdateRuleSchedule: {
Name: "update_schedule",
PermissionRequired: true,
},
OpRemoveRule: {
Name: "delete",
PermissionRequired: true,
},
OpListRules: {
Name: "list",
PermissionRequired: true,
},
OpEnableRule: {
Name: "enable",
PermissionRequired: true,
},
OpDisableRule: {
Name: "disable",
PermissionRequired: true,
},
}
}