mikerhodes commented on issue #1554: Additional Mango-based update handler / 
VDU functionality
URL: https://github.com/apache/couchdb/issues/1554#issuecomment-413811756
 
 
   I'll suggest the obvious: that the guards be mango selectors.
   
   I think "condition" may be the right term for the authorization's actual 
business logic (might be a better term from the authorization literature, but 
it escapes me right now).
   
   Combining the suggestion to split out the authz section into three fields:
   
   ```
   {
       "authorization": [
           {
               "guard": {"type": { "$eq": "post" }},
               "condition": {"author": { "$eq": "$userCtx.name" }},
               "throw": "you can’t update other user’s docs."
           },
          {
               "condition": {"type": {  "$in": ["post", "author"] }} ,
               "throw": "documents must be type 'post' or 'author'."
           },
       ]
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to