Files
goplt/ent/schema/permission.go
0x1d 97c3b76697 Restore complete Ent schema files
The schemas were incomplete (empty stubs). Restored complete schemas
from git history including refresh_token and user_role schemas, and
proper field definitions for auditlog and user entities.
2025-11-07 09:03:43 +01:00

33 lines
600 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Permission holds the schema definition for the Permission entity.
type Permission struct {
ent.Schema
}
// Fields of the Permission.
func (Permission) Fields() []ent.Field {
return []ent.Field{
field.String("id").
Unique().
Immutable(),
field.String("name").
Unique().
NotEmpty().
Comment("Format: module.resource.action"),
}
}
// Edges of the Permission.
func (Permission) Edges() []ent.Edge {
return []ent.Edge{
edge.To("role_permissions", RolePermission.Type),
}
}