SenseNet / sn-client

Monorepo for sensenet client packages 🐱‍💻
https://sensenet.com
GNU General Public License v2.0
24 stars 37 forks source link

Setting's key is not selectable in a content load request #824

Open enikonemeth opened 3 years ago

enikonemeth commented 3 years ago

🐜 Bug Report

📦 Package / Application

sensenet

😯 Current behavior

https://netcore-service.test.sensenet.com/odata.svc/Root/System/Settings/('Permission.settings')?metadata=no In this content there is a JSON which has a "groups" key, but on load I don't find any groups field

🤔 Expected behavior

https://netcore-service.test.sensenet.com/odata.svc/Root/System/Settings/('Permission.settings')?metadata=no If the settings content contains a key it would be available on the content and selectable in the query.

tusmester commented 3 years ago

Could not reproduce this bug, although the system works in a different way. @pusztaienike @taki9

For the following settings json (note the complex property):

{
  "UserType": "User",
  "Domain": "Public",
  "MyObject": {
    "Prop1": 1234,
    "Prop2": "text text text"   
    }
}

...and the following url (note the select parameter):

.../odata.svc/Root/System/Settings/('OAuth.settings')?metadata=no&$inlinecount=allpages&$top=10000&$select=Id,Name,Path,UserType,Domain,MyObject.Prop1

...I get the following response (note the flattened MyObject.Prop1):

{
   "d": {
   "Id": 1324,
   "Name": "OAuth.settings",
   "Path": "/Root/System/Settings/OAuth.settings",
   "UserType": "User",
   "Domain": "Public",
   "MyObject.Prop1": 1234
   }
}

Pls note that the current behavior is that complex types are flattened as multiple properties.

enikonemeth commented 3 years ago

What is the case with the following settings? I need the whole groups array. @tusmester

{
   "groups":[
      {
         "Read":["See", "Preview", "PreviewWithoutWatermark", "PreviewWithoutRedaction", "Open"]
      },
      {
         "Write":[ "Save", "AddNew", "Delete"]
      },
      {
         "Versioning":["OpenMinor", "Publish", "ForceCheckin", "Approve", "RecallOldVersion"]
      },
      {
         "Advanced":["SeePermissions", "SetPermissions", "RunApplication"]
      }
   ]
}