Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 61512 invoked from network); 19 Jan 2011 16:40:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jan 2011 16:40:31 -0000 Received: (qmail 57202 invoked by uid 500); 19 Jan 2011 16:40:31 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 57118 invoked by uid 500); 19 Jan 2011 16:40:28 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 57103 invoked by uid 99); 19 Jan 2011 16:40:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jan 2011 16:40:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jarias@ujaen.es designates 150.214.170.17 as permitted sender) Received: from [150.214.170.17] (HELO rus.ujaen.es) (150.214.170.17) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jan 2011 16:40:19 +0000 X-IronPort-AV: E=Sophos;i="4.60,345,1291590000"; d="scan'208";a="8860675" Received: from p097-113.ujaen.es (HELO [150.214.97.113]) ([150.214.97.113]) by smtp.ujaen.es with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 19 Jan 2011 17:39:57 +0100 Subject: Re: New information about my last email... From: Javier Arias To: users@jackrabbit.apache.org In-Reply-To: <4D36BA0C.2010704@adobe.com> References: <1294141528.3419.0.camel@sinai-vostro> <4D2318E6.6010200@adobe.com> <1295265899.3651.13.camel@sinai-vostro> <4D359463.1010307@adobe.com> <1295431225.8311.0.camel@sinai-vostro> <4D36BA0C.2010704@adobe.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 19 Jan 2011 17:39:56 +0100 Message-ID: <1295455196.4380.1.camel@sinai-vostro> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 8bit About the last send, the disabled function works now, I forgot call save() and logout() methods (I believed these function were called automatically). Sorry. About grant privileges an user, I am some lost. I understood first step and second step but I do not know how follow. How can I get AccessControlList? How grant privileges with User.getPrincipal? I give the code that I have at the moment: Repository repository = new TransientRepository(new File(_repository)); Session session = repository.login(new SimpleCredentials("user","pass".toCharArray())); UserManager userManager = ((JackrabbitSession) session).getUserManager(); AccessControlManager controlManager = ((JackrabbitSession) session).getAccessControlManager(); Authorizable authorizable = userManager.getAuthorizable("user"); Principal principal = (Principal) ((User) authorizable).getPrincipal(); --- Thank you. Regards El mié, 19-01-2011 a las 11:16 +0100, Angela Schreiber escribió: > hi javier > > On 1/19/11 11:00 AM, Javier Arias wrote: > > Hi Angela, my problem was solved. The problem was: supose I have > > "jackrabbit-standalone" in the > > folder: /home/user/server/jackrabbit-standalone.jar when you start > > jackrabbit-standalone it creates a folder "jackrabbit". I was creating a > > TransientRepository with url /home/user/server/ and not > > with /home/user/server/jackrabbit taht is the correct. Now it works > > perfectly. > > > > Besides , I have a new task. I want to allow only two users for my > > webdav server. One user will be admin. I have changed his password and I > > will use it only for management tasks. I have created another user to > > access to the repository to add and remove files, but with him, I can > > not upload resources to server. How I give him privileges to do it? > > use the jcr access control management to grant this editing user > the permissions to manipulate a node (and it's child nodes)... this most > probably includes the following privileges: > > jcr:modifyProperties > jcr:addChildNodes > jcr:removeNodes > jcr:removeChildNode > and eventually jcr:nodetypeManagement > > the first 4 privileges are aggregated in jcr:write, while rep:write > also includes the latter privilege. > > something like: > > 1. access the ac manager by means of session.getAccessControlManager() > 2. retrieve the applicable policies at your target node or - > alternatively - the policies already set to have them modified. > 3. in jr the policies are normally accesscontrollist(s) -> modify > the acl by granting the privileges for your users principal > (User.getPrincipal) > 4. reapply the modified policy (AcMgr.setPolicy) > 5. save the changes in order to have them take effect > > JSR283 and the API javadoc may give you some additional information > about how it works. jackrabbit in addition defines some extensions > to the JCR api. > > > Another problem is with anonymous user. I have removed this user but > > when I start the server, it is created again. I have tried too change > > the anonymous password but it does not work, the password is always the > > same. It is a problem because everyone can access with > > "anonymous/anonymous". > > the system users admin and anonymous are always recreated in the default > setup. but you may "disable" the anonymous user. this will prevent any > login as this user... see > > org.apache.jackrabbit.api.security.user.User#disable(String) > > hope that helps > angela > > Thank you. Best regards. > > > > > >