Body: <p>I need a simple plugin for approve access to an entry for specific users. Like this:</p>
  
  <ul>
  <li>array with approved entries ids for the currentUser</li>
  </ul>
  
  <blockquote>
    <p>GetApprovedEntries(currentUser.id)</p>
  </blockquote>
  
  <ul>
  <li>Approve entry for a user (from pending entry ids array)  and add to approvedEntries array and remove from pending array</li>
  </ul>
  
  <blockquote>
    <p>ApproveUserForEntry(user.id, entry.id)</p>
  </blockquote>
  
  <ul>
  <li>get all approved users for a specific entry</li>
  </ul>
  
  <blockquote>
    <p>getApprovedUsers(entry.id)</p>
  </blockquote>
  
  <ul>
  <li>Ask for entry access and add to pending array of the user</li>
  </ul>
  
  <blockquote>
    <p>AskEntryAccess(currentUser.id, entry.id)</p>
  </blockquote>
  
  <p>How I do this (add an array to a user), i am not a plugin developer.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-08T18:05:11.650Z
Comments.Text: How are you planning on specifying which users can access which entries?
Comments.UserDisplayName: Stephen Lewis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-08T18:46:41.677Z
Comments.Text: The approved ids match to a channel groups and al other entries and channels have a relation to one of the groups. On a entry page I'll check  which group the entry has and if the group id has a match with the allow plugin array from the current user. If a match the user is granted otherwise he is denied.
Comments.UserDisplayName: Maarten Heideman
Tags: <plugin-development>
Title: How make a simple approve entry plugin?
ThreadText: # How make a simple approve entry plugin?
  
  (Asked by: username_0 on 2017-03-08)
  
  I need a simple plugin for approve access to an entry for specific users. Like this:
  
  * array with approved entries ids for the currentUser
  
  > GetApprovedEntries(currentUser.id)
  
  * Approve entry for a user (from pending entry ids array) and add to approvedEntries array and remove from pending array
  
  > ApproveUserForEntry(user.id, entry.id)
  
  * get all approved users for a specific entry
  
  > getApprovedUsers(entry.id)
  
  * Ask for entry access and add to pending array of the user
  
  > AskEntryAccess(currentUser.id, entry.id)
  
  How I do this (add an array to a user), i am not a plugin developer.
  
  **Tags:** plugin-development
  
  > **Comments:**
  > **username_1**: How are you planning on specifying which users can access which entries?  
  > **username_0**: The approved ids match to a channel groups and al other entries and channels have a relation to one of the groups. On a entry page I'll check  which group the entry has and if the group id has a match with the allow plugin array from the current user. If a match the user is granted otherwise he is denied.  
  
  ---
  
  ## 0 answers
  
  