https://www.argeo.org/bugzilla/show_bug.cgi?id=148
git-svn-id: https://svn.argeo.org/commons/trunk@6175
4cfe0d0a-d680-48aa-b62c-
e0a02a3f76cc
org.argeo.security.equinox,\
#org.argeo.security.ui.initialPerspective=org.argeo.osgi.ui.explorer.perspective
org.argeo.security.equinox,\
#org.argeo.security.ui.initialPerspective=org.argeo.osgi.ui.explorer.perspective
-argeo.node.repo.uri=http://localhost:7070/org.argeo.jcr.webapp/remoting/node
+argeo.node.repo.uri=http://localhost:7070/data/jcr/node
log4j.configuration=file:../../log4j.properties
log4j.configuration=file:../../log4j.properties
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="repositoryFactory" class="org.argeo.jackrabbit.OsgiJackrabbitRepositoryFactory">
+ <property name="bundleContext" ref="bundleContext" />
+ </bean>
+
+</beans>
\ No newline at end of file
http://www.springframework.org/schema/util\r
http://www.springframework.org/schema/util/spring-util-2.5.xsd">\r
\r
http://www.springframework.org/schema/util\r
http://www.springframework.org/schema/util/spring-util-2.5.xsd">\r
\r
- <!-- REFERENCE -->\r
- <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
-\r
<!-- SERVICES -->\r
<service ref="authenticationManager"\r
interface="org.springframework.security.AuthenticationManager" />\r
\r
<!-- SERVICES -->\r
<service ref="authenticationManager"\r
interface="org.springframework.security.AuthenticationManager" />\r
\r
+ <service ref="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
+\r
</beans:beans>
\ No newline at end of file
</beans:beans>
\ No newline at end of file
<activity
description="Non admins"
id="org.argeo.security.ui.notAdminActivity"
<activity
description="Non admins"
id="org.argeo.security.ui.notAdminActivity"
<enabledWhen>
<not>
<with variable="roles">
<enabledWhen>
<not>
<with variable="roles">
</not>
</enabledWhen>
</activity>
</not>
</enabledWhen>
</activity>
+ <activity
+ description="Non remote"
+ id="org.argeo.security.ui.notRemoteActivity"
+ name="NonRemote">
+ <enabledWhen>
+ <not>
+ <with variable="roles">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="ROLE_REMOTE" />
+ </iterate>
+ </with>
+ </not>
+ </enabledWhen>
+ </activity>
<activityPatternBinding
activityId="org.argeo.security.ui.adminActivity"
isEqualityPattern="true"
<activityPatternBinding
activityId="org.argeo.security.ui.adminActivity"
isEqualityPattern="true"
private RepositoryFactory repositoryFactory;
private BundleContext bundleContext;
private RepositoryFactory repositoryFactory;
private BundleContext bundleContext;
+ public final static String ROLE_REMOTE = "ROLE_REMOTE";
+
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
NodeAuthenticationToken siteAuth = (NodeAuthenticationToken) authentication;
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
NodeAuthenticationToken siteAuth = (NodeAuthenticationToken) authentication;
- Node userHome = UserJcrUtils.getUserHome(session);
+ // Node userHome = UserJcrUtils.getUserHome(session);
// retrieve remote roles
List<GrantedAuthority> authoritiesList = new ArrayList<GrantedAuthority>();
// retrieve remote roles
List<GrantedAuthority> authoritiesList = new ArrayList<GrantedAuthority>();
- if (userHome != null
- && userHome.hasProperty(ArgeoNames.ARGEO_REMOTE_ROLES)) {
- Value[] roles = userHome.getProperty(
+ if (userProfile != null
+ && userProfile.hasProperty(ArgeoNames.ARGEO_REMOTE_ROLES)) {
+ Value[] roles = userProfile.getProperty(
ArgeoNames.ARGEO_REMOTE_ROLES).getValues();
for (int i = 0; i < roles.length; i++)
authoritiesList.add(new GrantedAuthorityImpl(roles[i]
.getString()));
}
ArgeoNames.ARGEO_REMOTE_ROLES).getValues();
for (int i = 0; i < roles.length; i++)
authoritiesList.add(new GrantedAuthorityImpl(roles[i]
.getString()));
}
+ authoritiesList.add(new GrantedAuthorityImpl(ROLE_REMOTE));
// create authenticated objects
GrantedAuthority[] authorities = authoritiesList
// create authenticated objects
GrantedAuthority[] authorities = authoritiesList
.getVersionManager();
if (versionManager.isCheckedOut(userProfile.getPath()))
versionManager.checkin(userProfile.getPath());
.getVersionManager();
if (versionManager.isCheckedOut(userProfile.getPath()))
versionManager.checkin(userProfile.getPath());
+
+ }
+
+ // Remote roles
+ if (roles != null) {
+ writeRemoteRoles(userProfile, roles);
}
return userProfile;
} catch (RepositoryException e) {
}
return userProfile;
} catch (RepositoryException e) {