• Announcements

    • Shane D.

      Evernote Business Beta - Spaces   12/20/2017

      We're very excited to announce the public beta of an upcoming rework for Evernote Business! To learn more, go Here
    • Shane D.

      2018 Evernote Webinars   01/04/2018

      To kick off the new year, we're excited to announce our  updated schedule for our series of webinars! Please check the events calendar to see which one works best for you!
    • Shane D.

      Upcoming Forum Change Announcement   02/14/2018

      Hi All! You may be seeing some changes with overall organization and layout of the discussion forums. You can learn more by going to the 'Upcoming Forum Change Announcement' in the 'Community Announcements' sub-forum!  
Antoine Lyset

How to know if we can share a note ?

Recommended Posts

All the notes in the user's account are editable by the owner. It gets more tricky with notebooks that are shared by other users (learn more about sharing here). The list of all other users' notebooks are defined by linked notebooks. A reference of that sharing is stored in the owner's account as a SharedNotebook that contains the permissions given to other users. Here is a portion of code to help you understand how to get the sharednotebook and access the permissions:


$linkedNotebook = current($linkedNotebooks);
$parts = parse_url($linkedNotebook->noteStoreUrl);
if (!isset($parts['port'])) {
if ($parts['scheme'] === 'https') {
$parts['port'] = 443;
} else {
$parts['port'] = 80;
}
}
$sharedNoteStoreHttpClient =
new THttpClient($parts['host'], $parts['port'], $parts['path'], $parts['scheme']);
$sharedNoteStoreProtocol = new TBinaryProtocol($sharedNoteStoreHttpClient);
$sharedNoteStore = new NoteStoreClient($sharedNoteStoreProtocol, $sharedNoteStoreProtocol);
$sharedAuthResult =
$sharedNoteStore->authenticateToSharedNotebook($linkedNotebook->shareKey, $authToken);
$sharedAuthToken = $sharedAuthResult->authenticationToken;
$sharedNotebook = $sharedNoteStore->getSharedNotebookByAuth($sharedAuthToken);
// permissions are stored in $sharedNotebook-> notebookModifiable

Share this post


Link to post

The PrivilegeLevel GROUP is only used in a business context when sharing with the entire company. It is designed to propagate sharing configuration changes for notebooks that are in the Business library. The associated privilege level for those notebook are inherited from the Notebook.businessNotebook field.

Here is an example: if I share a notebook in read only mode with all the users in my business (sharedNotebook.SharedNotebookPrivilegeLevel = 3 and Notebook.businessNotebook = 1) and later decide to make it editable (sharedNotebook.SharedNotebookPrivilegeLevel = 3 and Notebook.businessNotebook = 5) all the users that have the previous permissions get full access as well.

Share this post


Link to post