Index: topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java diff -u topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java:1.5 topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java:1.6 --- topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java:1.5 Fri Dec 21 17:26:45 2007 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java Fri Mar 7 09:25:37 2008 @@ -1,6 +1,6 @@ /* *##% * Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, - * Cédric Pineau, Benjamin Poussin, + * C�dric Pineau, Benjamin Poussin, * * * This program is free software; you can redistribute it and/or @@ -21,13 +21,13 @@ /* * * TopiaPolicy.java * - * Created: 17 févr. 2006 + * Created: 17 f�vr. 2006 * * @author Arnaud Thimel - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Mise a jour: $Date: 2007-12-21 17:26:45 $ - * par : $Author: ruchaud $ + * Mise a jour: $Date: 2008-03-07 09:25:37 $ + * par : $Author: thimel $ */ package org.codelutin.topia.taas.jaas; @@ -48,7 +48,7 @@ import org.codelutin.topia.taas.TaasService; /** - * Implantation d'un policy avec une prise en compte des permissions à la volée. + * Implantation d'un policy avec une prise en compte des permissions � la vol�e. * @author ruchaud */ public class TaasPolicy extends Policy { @@ -60,7 +60,7 @@ protected TaasService taasService; /** - * Constructeur par défaut + * Constructeur par d�faut */ public TaasPolicy(TaasService taasService) { this.taasService = taasService; @@ -99,7 +99,7 @@ public PermissionCollection getPermissions(ProtectionDomain domain) { PermissionCollection pc = parentPolicy.getPermissions(domain); - Subject subject = taasService.getSubject(); + Subject subject = taasService.findSubject(); if (subject != null) { for (Principal principal : subject.getPrincipals()) { if(principal instanceof TaasPrincipalWrapper) { @@ -114,7 +114,7 @@ } } } else { - log.error("Récupération des Permissions impossible"); + log.error("R�cup�ration des Permissions impossible"); } return pc; } @@ -141,8 +141,8 @@ } /** - * Installe cette TopiaPolicy. Si la Policy existante est déja cette - * TopiaPolicy alors la méthode n'a pas d'effet. Si une autre Policy existe + * Installe cette TopiaPolicy. Si la Policy existante est d�ja cette + * TopiaPolicy alors la m�thode n'a pas d'effet. Si une autre Policy existe * deja alors cette TopiaPolicy, elle conserve l'ancienne Policy dans * parentPolicy et la remplace alors. */ Index: topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinderImpl.java diff -u /dev/null topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinderImpl.java:1.1 --- /dev/null Fri Mar 7 09:25:42 2008 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinderImpl.java Fri Mar 7 09:25:37 2008 @@ -0,0 +1,54 @@ +/* *##% + * Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, + * C�dric Pineau, Benjamin Poussin, + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * TaasSubjectImpl.java + * + * Created: 10 f�vr. 2006 + * + * @author Arnaud Thimel + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2008-03-07 09:25:37 $ + * par : $Author: thimel $ + */ + +package org.codelutin.topia.taas.jaas; + +import java.security.AccessControlContext; +import java.security.AccessController; + +import javax.security.auth.Subject; + +/** + * Impl�mentation d'un r�cup�ration du subject + * + * @author julien + * + */ +public class TaasSubjectFinderImpl implements TaasSubjectFinder { + + public Subject findSubject() { + AccessControlContext context = AccessController.getContext(); + Subject subject = Subject.getSubject(context); + return subject; + } + +} Index: topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinder.java diff -u /dev/null topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinder.java:1.1 --- /dev/null Fri Mar 7 09:25:42 2008 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectFinder.java Fri Mar 7 09:25:37 2008 @@ -0,0 +1,48 @@ +/* *##% + * Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, + * C�dric Pineau, Benjamin Poussin, + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * TaasSubject.java + * + * Created: 10 f�vr. 2006 + * + * @author Arnaud Thimel + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2008-03-07 09:25:37 $ + * par : $Author: thimel $ + */ + +package org.codelutin.topia.taas.jaas; + +import javax.security.auth.Subject; + +/** + * Interface permettant de r�cup�rer le subject en fonction du context + * d'�xecution de taas (java, ejb, ...) + * + * @author julien + * + */ +public interface TaasSubjectFinder { + + public Subject findSubject(); + +}