1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00

Merge pull request #2370 from anyproto/go-5462-allow-collection-type-change

GO-5462 Remove TypeChange restriction from collection
This commit is contained in:
Kirill Stonozhenko 2025-05-12 15:33:58 +03:00 committed by GitHub
commit 48769892a4
Signed by: github
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -373,6 +373,9 @@ func (bs *basic) getLayoutForType(objectTypeKey domain.TypeKey) (model.ObjectTyp
func (bs *basic) SetLayoutInState(s *state.State, toLayout model.ObjectTypeLayout, ignoreRestriction bool) (err error) {
fromLayout, _ := s.Layout()
if fromLayout == toLayout {
return nil
}
if !ignoreRestriction {
if err = bs.Restrictions().Object.Check(model.Restrictions_LayoutChange); errors.Is(err, restriction.ErrRestricted) {

View file

@ -41,7 +41,7 @@ var (
model.ObjectType_note: {},
model.ObjectType_bookmark: {},
model.ObjectType_set: objRestrictEdit,
model.ObjectType_collection: objRestrictEdit,
model.ObjectType_collection: objRestrictEdit.Copy().Remove(model.Restrictions_TypeChange),
model.ObjectType_relationOptionsList: {
model.Restrictions_Template: {},
},