<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to prevent user  with ONLY READ permission from deleting, modifying, and adding tags? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-prevent-user-with-only-read-permission-from-deleting/m-p/313662#M663</link>
    <description>&lt;P&gt;I did this by extending the TagActionsBean and overriding the addTagging and removeTagging methods. In my case I allow actions based on group memberships. So within addTagging and removeTagging I call a custom method to check membership -- the custom method gets Principal and determines group membership (see below) -- if user is allowed to add/remove tags custom method returns true, otherwise false...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;private boolean taggingIsPermitted(DocumentModel currentDocument) {
	// document is locked so do not permit tagging action
	if (currentDocument.isLocked()) {
		return false;
	}
	
	// if document is not locked then check to make sure READ only users cannot tag
	Principal principal = documentManager.getPrincipal();
	NuxeoPrincipal np = (NuxeoPrincipal) principal;
	if (!(np.isMemberOf("librarians") || np.isMemberOf("managers") || np.isMemberOf("powerusers"))) {
		return false;
	}
	
	return true;
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Aug 2014 22:47:49 GMT</pubDate>
    <dc:creator>bruce_Grant</dc:creator>
    <dc:date>2014-08-26T22:47:49Z</dc:date>
    <item>
      <title>How to prevent user  with ONLY READ permission from deleting, modifying, and adding tags?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-prevent-user-with-only-read-permission-from-deleting/m-p/313661#M662</link>
      <description>&lt;P&gt;I need a situation where user with only READ permission can't add tags, delete or modify tags added by another user which has higher granted permission.&lt;BR /&gt; /&amp;gt;
Please, can someone help me?&lt;BR /&gt; /&amp;gt;
I would be very grateful, Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Aug 2014 14:50:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-prevent-user-with-only-read-permission-from-deleting/m-p/313661#M662</guid>
      <dc:creator>altan_</dc:creator>
      <dc:date>2014-08-16T14:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent user  with ONLY READ permission from deleting, modifying, and adding tags?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-prevent-user-with-only-read-permission-from-deleting/m-p/313662#M663</link>
      <description>&lt;P&gt;I did this by extending the TagActionsBean and overriding the addTagging and removeTagging methods. In my case I allow actions based on group memberships. So within addTagging and removeTagging I call a custom method to check membership -- the custom method gets Principal and determines group membership (see below) -- if user is allowed to add/remove tags custom method returns true, otherwise false...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;private boolean taggingIsPermitted(DocumentModel currentDocument) {
	// document is locked so do not permit tagging action
	if (currentDocument.isLocked()) {
		return false;
	}
	
	// if document is not locked then check to make sure READ only users cannot tag
	Principal principal = documentManager.getPrincipal();
	NuxeoPrincipal np = (NuxeoPrincipal) principal;
	if (!(np.isMemberOf("librarians") || np.isMemberOf("managers") || np.isMemberOf("powerusers"))) {
		return false;
	}
	
	return true;
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Aug 2014 22:47:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-prevent-user-with-only-read-permission-from-deleting/m-p/313662#M663</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2014-08-26T22:47:49Z</dc:date>
    </item>
  </channel>
</rss>

