Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

How to allow only the specified users/groups to open my pdf files...


Former Community Member
Hi there,

I'm looking for resources/documents describing how to allow only the specified users/groups to open my pdf files by the Java API...

I've found a sample code creating a policy in the following document.


( API Quick Starts (Code Examples) > Rights Management Service API Quick Starts > Quick Start: Creating a new policy using the Java API )

But the sample code doesn't set recepients( users/groups ) who can open the pdf file.

How can I make it ?

Any samples ? or Does anybody can tell me which Java classes/methods I should use ??

Policy#addPolicyEntry(PolicyEntry policyEntry) ??

PolicyEntry#setPrincipal(Principal principal) ??

or none of them ?

Any hints are appreciated !

3 Replies


Former Community Member
mail me mergeandfuse@gmail.com,will try and send you the required info


Level 10
Please post the info back to this post when you find the solution.



Former Community Member
I'm not exactly sure what you are tying to do here, but typical approach when issuing one PDF par user/groups scenario goes like:

1. Create policy for specific purpose and add principal (user/group)

2. Apply policy on server side

3. Deliver the file (via email etc...)

If you are looking for sample codes, try quick start.


If you go "API Quick Start/Rights Management Service API Quick Starts", you might find something useful. I think you need "Creating Policies" or "Modifying Policies" for step 1 above, and "Applying Policies to PDF Documents" for step 2.

Hope this helps.