You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by rohitiwari30oct <ro...@gmail.com> on 2016/02/21 14:27:22 UTC

Public link for jcr documents

Hi,

I had developed a web portal for creating, uploading file/folders using
Jackrabbit 2.8.1 and Jcr 2.0. I usually provide access for docs with LDAP
authentication but in some cases I required a way to get public access url
for some of our users. If any one can help it would be highly appreciable. 



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Public-link-for-jcr-documents-tp4663698.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: Public link for jcr documents

Posted by Clay Ferguson <wc...@gmail.com>.
I hope this is helpful and not an oversimplification of what you're after,
but here's how I make a node public in meta64 (search it on GitHub):

public static void makeNodePublic(Session session, Node node) throws
Exception {
List<String> privileges = new LinkedList<String>();
privileges.add(Privilege.JCR_READ);
grantPrivileges(session, node, EveryonePrincipal.getInstance(), privileges);
}

Cheers, and happy Jackrabbiting.


Best regards,
Clay Ferguson
wclayf@gmail.com


On Sun, Feb 21, 2016 at 7:27 AM, rohitiwari30oct <ro...@gmail.com>
wrote:

> Hi,
>
> I had developed a web portal for creating, uploading file/folders using
> Jackrabbit 2.8.1 and Jcr 2.0. I usually provide access for docs with LDAP
> authentication but in some cases I required a way to get public access url
> for some of our users. If any one can help it would be highly appreciable.
>
>
>
> --
> View this message in context:
> http://jackrabbit.510166.n4.nabble.com/Public-link-for-jcr-documents-tp4663698.html
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.
>

Re: Public link for jcr documents

Posted by Davide Giannella <da...@apache.org>.
On 25/02/2016 05:40, rohitiwari30oct wrote:
> Hi thanks for answer. 
>
> I mean by "Public access to some users" is that I wanted to create a public
> url for a node so that there would have no need of authentication to access
> that node. That node is a jcr:document node where a binary file stored in
> its jcr:data property. When anyone try to access that url, it should
> download that file. 
>

Again, I'm not expert in the ACL/Authentication area; but as far as I
remember, in JR we have an anonymous user which does not require
authentication. If you assign read privileges to the required nodes to
such user you should get a publicly accessible URL.

HTH
Davide



Re: Public link for jcr documents

Posted by rohitiwari30oct <ro...@gmail.com>.
Hi thanks for answer. 

I mean by "Public access to some users" is that I wanted to create a public
url for a node so that there would have no need of authentication to access
that node. That node is a jcr:document node where a binary file stored in
its jcr:data property. When anyone try to access that url, it should
download that file. 

regards
rohit

In Reply To
Re: Public link for jcr documents
Feb 22, 2016; 7:48pm — by Davide Giannella Davide Giannella
On 21/02/2016 13:27, rohitiwari30oct wrote:
> Hi,
>
> I had developed a web portal for creating, uploading file/folders using
> Jackrabbit 2.8.1 and Jcr 2.0. I usually provide access for docs with LDAP
> authentication but in some cases I required a way to get public access url
> for some of our users. If any one can help it would be highly appreciable.
>

I didn't really understand the use case "public access for some users".
By saying some users I imply that you want that URL to be, rather than
public, always secured and only a group of users has access to it.

In JR we have groups as well beside users. You'll have to deal with the
ACL of the specific node by providing either the list of users
explicitly or by providing a group under which the users are registered.

I think these two links could help you out

http://wiki.apache.org/jackrabbit/UserManagement
http://wiki.apache.org/jackrabbit/AccessControl

Cheers
Davide 



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Public-link-for-jcr-documents-tp4663698p4663706.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: Public link for jcr documents

Posted by Clay Ferguson <wc...@gmail.com>.
If you are saying "some users" behave one way, and some users behave
another way, then this is called a "group", in Jackrabbit and you MUST use
a group. Also it's the only way it even makes any sense. Some users is
synonymous with "group of users". I think what you are wanting is
'read-only' access by a specific group, but you are just confused about
terminology. The word "public" means "everyone" can see it (at least for
read-only). So once you learn the definitions of those words you will then
be able to ask your question properly.

Best regards,
Clay Ferguson
wclayf@gmail.com


On Wed, Feb 24, 2016 at 11:32 PM, rohitiwari30oct <rohitiwari30oct@gmail.com
> wrote:

> Hi thanks. I mean by "Public access to some users" is that I wanted to
> create
> a public url for a node so that there would have no need of authentication
> to access that node. That node is a jcr:document node where a binary file
> stored in its jcr:data property. When anyone try to access that url, it
> should download that file.
>
>
>
> --
> View this message in context:
> http://jackrabbit.510166.n4.nabble.com/Public-link-for-jcr-documents-tp4663698p4663705.html
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.
>

Re: Public link for jcr documents

Posted by rohitiwari30oct <ro...@gmail.com>.
Hi thanks. I mean by "Public access to some users" is that I wanted to create
a public url for a node so that there would have no need of authentication
to access that node. That node is a jcr:document node where a binary file
stored in its jcr:data property. When anyone try to access that url, it
should download that file. 



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Public-link-for-jcr-documents-tp4663698p4663705.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: Public link for jcr documents

Posted by Davide Giannella <da...@apache.org>.
On 21/02/2016 13:27, rohitiwari30oct wrote:
> Hi,
>
> I had developed a web portal for creating, uploading file/folders using
> Jackrabbit 2.8.1 and Jcr 2.0. I usually provide access for docs with LDAP
> authentication but in some cases I required a way to get public access url
> for some of our users. If any one can help it would be highly appreciable. 
>

I didn't really understand the use case "public access for some users".
By saying some users I imply that you want that URL to be, rather than
public, always secured and only a group of users has access to it.

In JR we have groups as well beside users. You'll have to deal with the
ACL of the specific node by providing either the list of users
explicitly or by providing a group under which the users are registered.

I think these two links could help you out

http://wiki.apache.org/jackrabbit/UserManagement
http://wiki.apache.org/jackrabbit/AccessControl

Cheers
Davide