Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat(authz): register role and assignee relationships (#10538)

Vikrant Guptaec543eb89cc4
diff --git a/ee/authz/openfgaauthz/provider.go b/ee/authz/openfgaauthz/provider.go
index 82e703888f..7f388319fb 100644
--- a/ee/authz/openfgaauthz/provider.go
+++ b/ee/authz/openfgaauthz/provider.go
@@ -176,6 +176,7 @@ func (provider *provider) GetResources(_ context.Context) []*authtypes.Resource
typeables = append(typeables, register.MustGetTypeables()...)
}
+ typeables = append(typeables, provider.MustGetTypeables()...)
resources := make([]*authtypes.Resource, 0)
for _, typeable := range typeables {
resources = append(resources, &authtypes.Resource{Name: typeable.Name(), Type: typeable.Type()})
diff --git a/frontend/src/hooks/useAuthZ/permissions.type.ts b/frontend/src/hooks/useAuthZ/permissions.type.ts
index 66288aab55..fe47165ad7 100644
--- a/frontend/src/hooks/useAuthZ/permissions.type.ts
+++ b/frontend/src/hooks/useAuthZ/permissions.type.ts
@@ -11,8 +11,17 @@ export default {
name: 'dashboards',
type: 'metaresources',
},
+ {
+ name: 'role',
+ type: 'role',
+ },
+ {
+ name: 'roles',
+ type: 'metaresources',
+ },
],
relations: {
+ assignee: ['role'],
create: ['metaresources'],
delete: ['user', 'role', 'organization', 'metaresource'],
list: ['metaresources'],
diff --git a/pkg/types/authtypes/relation.go b/pkg/types/authtypes/relation.go
index 41643c093a..c6735c5911 100644
--- a/pkg/types/authtypes/relation.go
+++ b/pkg/types/authtypes/relation.go
@@ -28,11 +28,12 @@ var TypeableRelations = map[Type][]Relation{
}
var RelationsTypeable = map[Relation][]Type{
- RelationCreate: {TypeMetaResources},
- RelationRead: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
- RelationList: {TypeMetaResources},
- RelationUpdate: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
- RelationDelete: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
+ RelationCreate: {TypeMetaResources},
+ RelationRead: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
+ RelationList: {TypeMetaResources},
+ RelationUpdate: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
+ RelationDelete: {TypeUser, TypeRole, TypeOrganization, TypeMetaResource},
+ RelationAssignee: {TypeRole},
}
type Relation struct{ valuer.String }