feat(group): add group permissions (#10853)

# Which Problems Are Solved
Ensuring the user group resource is managed with appropriate
permissions.

# How the Problems Are Solved
By configuring and checking for the relevant permissions needed to
create, read, update, and delete the user groups resource.

# Additional Changes
N/A

# Additional Context
- Related to #9702 
- Follow-up for PRs #10455,  #10758
This commit is contained in:
Gayathri Vijayan
2025-10-21 11:18:21 +02:00
committed by GitHub
parent ff869482b1
commit ebc6c503a3
13 changed files with 1065 additions and 145 deletions
-27
View File
@@ -1,32 +1,5 @@
package domain
import (
"strings"
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
"github.com/zitadel/zitadel/internal/zerrors"
)
const (
maxGroupNameLen = 200
)
// Group represents a user group in an organization
type Group struct {
models.ObjectRoot
Name string
Description string
}
func (g *Group) IsValid() error {
groupName := strings.TrimSpace(g.Name)
if groupName == "" || len(groupName) > maxGroupNameLen {
return zerrors.ThrowInvalidArgument(nil, "GROUP-m177lN", "Errors.Group.InvalidName")
}
return nil
}
type GroupState int32
const (
+4
View File
@@ -70,6 +70,10 @@ const (
PermissionIAMPolicyWrite = "iam.policy.write"
PermissionIAMPolicyDelete = "iam.policy.delete"
PermissionPolicyRead = "policy.read"
PermissionGroupCreate = "group.create"
PermissionGroupWrite = "group.write"
PermissionGroupRead = "group.read"
PermissionGroupDelete = "group.delete"
)
// ProjectPermissionCheck is used as a check for preconditions dependent on application, project, user resourceowner and usergrants.