light modification

This commit is contained in:
mr
2025-01-21 09:02:26 +01:00
parent e741a95cdb
commit 5c2980fb36
2 changed files with 3 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ import (
type AbstractResource struct {
utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
Type string `json:"type,omitempty" bson:"type,omitempty"` // Type is the type of the resource
Logo string `json:"logo,omitempty" bson:"logo,omitempty" validate:"required"` // Logo is the logo of the resource
Description string `json:"description,omitempty" bson:"description,omitempty"` // Description is the description of the resource
ShortDescription string `json:"short_description,omitempty" bson:"short_description,omitempty" validate:"required"` // ShortDescription is the short description of the resource
@@ -85,6 +86,7 @@ func (abs *AbstractIntanciatedResource[T]) SetAllowedInstances(request *tools.AP
}
func (d *AbstractIntanciatedResource[T]) Trim() {
d.Type = d.GetType()
if ok, _ := (&peer.Peer{AbstractObject: utils.AbstractObject{UUID: d.CreatorID}}).IsMySelf(); !ok {
for _, instance := range d.Instances {
instance.ClearPeerGroups()