Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

How to know if we can share a note ?

business rights

  • Please log in to reply
8 replies to this topic

#1 Antoine Lyset

Antoine Lyset

  • Pip
  • Title: Member
  • Group: Members
  • 8 posts

Posted 22 January 2013 - 09:19 AM

Hi,

I checked with listSharedNotebooks and the ShareNotebookPrivilegeLevel for each SharedNotebook. But the GROUP PrivilegeLevel (3) seems a bit confusing. Where can I have the PrivilegeLevel of this GROUP ?

Do I really need to do all this API calls just to know if I have the User have the PrivilegeLevel to call the shareNote method ?

#2 Kentaro

Kentaro

  • Title: Browncoat
  • Group: Evernote Employee
  • 265 posts

Posted 22 January 2013 - 11:46 PM

Hi,

You can share notes you own.
http://dev.evernote....Store_shareNote

#3 Antoine Lyset

Antoine Lyset

  • Pip
  • Title: Member
  • Group: Members
  • 8 posts

Posted 23 January 2013 - 02:23 PM

Yes I know it. But how to know if the user owns the note ? As I said "I checked with listSharedNotebooks and the ShareNotebookPrivilegeLevel for each SharedNotebook. But the GROUP PrivilegeLevel (3) seems a bit confusing. Where can I have the PrivilegeLevel of this GROUP ?".

#4 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 23 January 2013 - 06:39 PM

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


#5 Antoine Lyset

Antoine Lyset

  • Pip
  • Title: Member
  • Group: Members
  • 8 posts

Posted 23 January 2013 - 07:00 PM

Ok, NotebookModifiable is flagged as deprecated. But we can still use it ? It's fully compatible with Evernote Business Notebooks ?

#6 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 23 January 2013 - 07:02 PM

You are correct, we updated that recently. Use sharedNotebook.SharedNotebookPrivilegeLevel instead.

#7 Antoine Lyset

Antoine Lyset

  • Pip
  • Title: Member
  • Group: Members
  • 8 posts

Posted 23 January 2013 - 07:11 PM

Ok but if the user belongs to the PrivilegeLevel 3 (GROUP Privilege), how can we see the Privilege of this particular Group ?

#8 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 24 January 2013 - 02:00 AM

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.

#9 Antoine Lyset

Antoine Lyset

  • Pip
  • Title: Member
  • Group: Members
  • 8 posts

Posted 24 January 2013 - 08:30 AM

Thanks a lot ! I will try to applicate it now.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Clip to Evernote