cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Security policy

a_c
Confirmed Champ
Confirmed Champ

Hi, I need to block deletion of specific document types by user groups. I understand I need to write a custom security policy in order to achieve this, but I'm not sure how. So far, I have a java class extends AbstractSecurityPolicy implements SecurityPolicy that overrides the checkPermission method that returns an Access class which grants or denies permission. Is this the right way to do it? Or will it simply block the read permissions? Any help would be appreciated.

Thanks in advance

1 ACCEPTED ANSWER

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

I strongly advise you to watch https://university.nuxeo.com/learn/course/external/view/elearning/171/SecurityPolicies. It contains all the needed information with a practical use case (sources are available to help you).

General steps are:

  1. Create your project with Nuxeo CLI
  2. Initialize your JAVA Class
  3. Write the CheckPermission method logic
  4. Build your SQLQueryTransformer
  5. Create an XML Extension
  6. Create your marketplace package

Regards

View answer in original post

3 REPLIES 3

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

I strongly advise you to watch https://university.nuxeo.com/learn/course/external/view/elearning/171/SecurityPolicies. It contains all the needed information with a practical use case (sources are available to help you).

General steps are:

  1. Create your project with Nuxeo CLI
  2. Initialize your JAVA Class
  3. Write the CheckPermission method logic
  4. Build your SQLQueryTransformer
  5. Create an XML Extension
  6. Create your marketplace package

Regards

Thank you for your answer! But I have another issue

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Security Policies are core securities: therefore, they are not "controlled" by the UI, leading by the kind of erro you have (the typical 403 - PERMISSION DENIED). So I would advice to implement UI logics (with Javascript to implement your conditions, in nuxeo-filter elements) in addition to the security policies.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.