mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-28 15:08:51 +00:00
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:
@@ -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 (
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user