<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[API permissions - User who has permission on DataSource cannot create Datapoint to that source.]]></title><description><![CDATA[<p dir="auto">A attempt will be awarded a  422 http code. "Must retain permission". Not a 401 "Not Authorized". So perhaps I am missing something.</p>
<p dir="auto">I am not sure if this makes sense. If the admin chooses to give a user edit access to a DataSource, it seems logical that that user should also be able to create DataPoints. If the admin is concerned with DataSource security, the admin should not give the user edit permission to the DataSource, but only to DataPoints.</p>
]]></description><link>https://forum.mango-os.com/topic/4709/api-permissions-user-who-has-permission-on-datasource-cannot-create-datapoint-to-that-source</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 12:13:42 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4709.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Feb 2020 05:54:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:58:49 GMT]]></title><description><![CDATA[<p dir="auto">Looks like you've got it sorted, nicely done.</p>
]]></description><link>https://forum.mango-os.com/post/24706</link><guid isPermaLink="true">https://forum.mango-os.com/post/24706</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:57:08 GMT]]></title><description><![CDATA[<p dir="auto">No need for MangoUI other than now and then do Admin stuff, We use our own Dashboards.</p>
<p dir="auto"><img src="https://camo.nodebb.org/c44a6bd487af40f8624ed0cdc0c25fd0adc78db2?url=https%3A%2F%2Fi.imgur.com%2F4CA4m5a.jpg" alt="0_1581995259249_Image 130.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">The API will be used in device on-boarding. Admin creates User, JWT, DataSource (device). Sets new user role to DataSource. This info will be set in device, which creates its own DataPoints (15 to 50) and uploads measuring data to the system from then on.</p>
<p dir="auto">The JWT is not ideal from a security stand point, but good enough got us at the moment.</p>
<p dir="auto"><img src="https://camo.nodebb.org/06657343c336ad3ecc7254e278cf293eaf8599f3?url=https%3A%2F%2Fi.imgur.com%2F1aPF3Ya.jpg" alt="0_1581995701589_Image 131.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/24705</link><guid isPermaLink="true">https://forum.mango-os.com/post/24705</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:57:16 GMT]]></title><description><![CDATA[<p dir="auto">Save is a private call inside mango's mangoUI.<br />
You may as well use a controller, create a new point instance from the maPoint service, amend all of the values you need, then call</p>
<pre><code>myNewPoint.$save(); //this is a post call
</code></pre>
<p dir="auto">For amendments use</p>
<pre><code>myNewPoint.$update(); //this is a put call
</code></pre>
<p dir="auto">Attach those function calls to your own buttons, unless you're saying you're still having issues with the UI....</p>
]]></description><link>https://forum.mango-os.com/post/24704</link><guid isPermaLink="true">https://forum.mango-os.com/post/24704</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:57:16 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:37:49 GMT]]></title><description><![CDATA[<p dir="auto">Thanks. My goal is to keep the API request JSON as small as possible, so I omitted as much as possible to the POST request to create a DP. Too much.</p>
<p dir="auto">You are right.</p>
<pre><code>  "readPermission":"emon3175585",
  "setPermission":"emon3175585",
</code></pre>
<p dir="auto">needed to be added.</p>
<pre><code>{
  "name": "test12-test2",
  "xid": "test12-test2",
  "dataSourceXid" : "test12",
  "readPermission":"emon3175585",
  "setPermission":"emon3175585",
  "pointLocator" : {
       "startValue" : "0",
       "modelType" : "PL.VIRTUAL",
       "dataType" : "NUMERIC",
       "settable" : true,
       "changeType" : "NO_CHANGE",
       "max": 100,
       "maxChange": 0.01,
       "min": 0
    }
}
</code></pre>
<p dir="auto">My concern is the API, so that is solved.</p>
<p dir="auto">The GUI DP creation permission may still have a problem as there is no SAVE button.</p>
]]></description><link>https://forum.mango-os.com/post/24703</link><guid isPermaLink="true">https://forum.mango-os.com/post/24703</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:37:49 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:22:29 GMT]]></title><description><![CDATA[<p dir="auto">I see now, I think you're missing properties!<br />
If you go to the swagger ui and pull a point by it's xid for an example, use that as a foundation and make your amendments, then fire that back in.<br />
EDIT: at least add your user to have read only permission or else it cannot pull it through,</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/24702</link><guid isPermaLink="true">https://forum.mango-os.com/post/24702</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:22:29 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:19:28 GMT]]></title><description><![CDATA[<p dir="auto">There is no console error because there is no SAVE button to press.</p>
<p dir="auto">Using the API with JWT issued to user emon3175585:</p>
<pre><code>curl --location --request POST 'http://xx.xx.xx.xx:8080/rest/v2/data-points' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJFUzUxMiJ9.eyJzdWIiOiJlbW9uMzE3NTU4NSIsImV4cCI6MTU4MTk5NjgxMywiaWQiOjQsInYiOjEsInR5cCI6ImF1dGgifQ.AClqeOT6yAQCjGMYfXaMlDVgAcVOftGy3TSCrjxWat-Iz2yFut5nP4wntnE1xas3VtieFbxVwffbhmXwngPhHi8VAEFPPoaCD11unJ5_VTVWJkwnx73Eq8L2sbI9abLVM_CXXXXXXXXXXXXXX' \
--data-raw '{
  "name": "test12-test2",
  "xid": "test12-test2",
  "dataSourceXid" : "test12",
  "pointLocator" : {
       "startValue" : "0",
       "modelType" : "PL.VIRTUAL",
       "dataType" : "NUMERIC",
       "settable" : true,
       "changeType" : "NO_CHANGE",
       "max": 100,
       "maxChange": 0.01,
       "min": 0
    }
}'
</code></pre>
<p dir="auto">Results in error: 422 Unprocessable Entity</p>
<pre><code>{
  "result": {
    "messages": [
      {
        "level": "ERROR",
        "message": "Must retain permission",
        "property": "readPermission"
      },
      {
        "level": "ERROR",
        "message": "Must retain permission",
        "property": "setPermission"
      }
    ]
  },
  "mangoStatusCode": 4002,
  "mangoStatusName": "VALIDATION_FAILED",
  "localizedMessage": "Validation failed"
}
</code></pre>
]]></description><link>https://forum.mango-os.com/post/24701</link><guid isPermaLink="true">https://forum.mango-os.com/post/24701</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:03:43 GMT]]></title><description><![CDATA[<p dir="auto">Strange the lack of role would explain the error...<br />
console is still giving you the same exact error??</p>
]]></description><link>https://forum.mango-os.com/post/24700</link><guid isPermaLink="true">https://forum.mango-os.com/post/24700</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:03:43 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 02:00:47 GMT]]></title><description><![CDATA[<p dir="auto">Naturally. But that was set already:</p>
<p dir="auto"><img src="https://camo.nodebb.org/9cc6635e9b777cf28558fec9b244bd2f9ed03136?url=https%3A%2F%2Fi.imgur.com%2FYa7LnW4.jpg" alt="0_1581992332387_Image 129.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/24699</link><guid isPermaLink="true">https://forum.mango-os.com/post/24699</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Tue, 18 Feb 2020 02:00:47 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 01:13:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/balistar" aria-label="Profile: balistar">@<bdi>balistar</bdi></a> said in <a href="/post/24696">API permissions - User who has permission on DataSource cannot create Datapoint to that source.</a>:</p>
<blockquote>
<p dir="auto">emon3175585</p>
</blockquote>
<p dir="auto">Your user emon3175585<br />
must have permission emon3175585 assigned to it for it to work.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/24697</link><guid isPermaLink="true">https://forum.mango-os.com/post/24697</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 18 Feb 2020 01:13:15 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Tue, 18 Feb 2020 00:02:11 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your fast response.</p>
<p dir="auto">I am probably missing something.</p>
<p dir="auto">New DataSource created by Admin. User (emon3175585) given permission to edit the DataSource.</p>
<p dir="auto"><img src="https://camo.nodebb.org/2530e9a9daf03a2c84b635eb9472832002583e8a?url=https%3A%2F%2Fi.imgur.com%2FTyoHAxy.jpg" alt="0_1581985065225_Image 127.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Yet, when user (emon3175585) logs in, the user cannot create new DataPoint.</p>
<p dir="auto"><img src="https://camo.nodebb.org/0727a4ec7261c91f7fd67cd1b06822beb7120137?url=https%3A%2F%2Fi.imgur.com%2Fe2LFOh3.jpg" alt="0_1581985190960_Image 128.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/24696</link><guid isPermaLink="true">https://forum.mango-os.com/post/24696</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Tue, 18 Feb 2020 00:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Mon, 17 Feb 2020 23:45:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/balistar" aria-label="Profile: balistar">@<bdi>balistar</bdi></a> Correct, you need edit permissions for a Datasource for a user because what they are doing is amending the datasource in the order of its points. The read/edit permissions for points more directly relate to point values rather than amending the points themselves.</p>
]]></description><link>https://forum.mango-os.com/post/24695</link><guid isPermaLink="true">https://forum.mango-os.com/post/24695</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Mon, 17 Feb 2020 23:45:32 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Mon, 17 Feb 2020 23:42:44 GMT]]></title><description><![CDATA[<p dir="auto">Fox. Running Core 3.7.3.</p>
<p dir="auto">Admin creates new USER. Admin creates DataSource and gives READ and WRITE access to new user ONLY for that DataPoint.</p>
<p dir="auto">New USER can EDIT DataSource, but cannot create DataPoints .Both through GUI and API with JWT.</p>
<p dir="auto">Once Admin Creates a new DataPoint for that DataSource new user can edit that DataPoint.</p>
<p dir="auto">The intent of Permission to a DataSource works correctly after Admin has created one and assigned read/write permissions for that DataSource to a User, that User has edit/set ability to all DataPoints of that DataSource without that user having explicit read/write permission to those DataPoints. I guess permission inheritance works for this.</p>
]]></description><link>https://forum.mango-os.com/post/24694</link><guid isPermaLink="true">https://forum.mango-os.com/post/24694</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Mon, 17 Feb 2020 23:42:44 GMT</pubDate></item><item><title><![CDATA[Reply to API permissions - User who has permission on DataSource cannot create Datapoint to that source. on Mon, 17 Feb 2020 21:33:09 GMT]]></title><description><![CDATA[<p dir="auto">What version of mango are you using?<br />
I've got users who have edit access to virtual datasources and are able to create their own points/save tags etc on the fly.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/24691</link><guid isPermaLink="true">https://forum.mango-os.com/post/24691</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Mon, 17 Feb 2020 21:33:09 GMT</pubDate></item></channel></rss>