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.3 topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java:1.4 --- topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java:1.3 Thu Dec 13 16:48:16 2007 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasPolicy.java Fri Dec 21 17:01:14 2007 @@ -24,9 +24,9 @@ * Created: 17 févr. 2006 * * @author Arnaud Thimel - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * - * Mise a jour: $Date: 2007-12-13 16:48:16 $ + * Mise a jour: $Date: 2007-12-21 17:01:14 $ * par : $Author: ruchaud $ */ @@ -99,7 +99,7 @@ public PermissionCollection getPermissions(ProtectionDomain domain) { PermissionCollection pc = parentPolicy.getPermissions(domain); - Subject subject = Subject.getSubject(AccessController.getContext()); + Subject subject = taasService.getSubject(); if (subject != null) { for (Principal principal : subject.getPrincipals()) { TaasPrincipalWrapper principalWrapper = (TaasPrincipalWrapper) principal; Index: topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubject.java diff -u /dev/null topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubject.java:1.1 --- /dev/null Fri Dec 21 17:01:19 2007 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubject.java Fri Dec 21 17:01:13 2007 @@ -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: 2007-12-21 17:01:13 $ + * par : $Author: ruchaud $ + */ + +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 TaasSubject { + + public Subject getSubject(); + +} Index: topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectImpl.java diff -u /dev/null topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectImpl.java:1.1 --- /dev/null Fri Dec 21 17:01:19 2007 +++ topia-service/src/java/org/codelutin/topia/taas/jaas/TaasSubjectImpl.java Fri Dec 21 17:01:14 2007 @@ -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: 2007-12-21 17:01:14 $ + * par : $Author: ruchaud $ + */ + +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 TaasSubjectImpl implements TaasSubject { + + public Subject getSubject() { + AccessControlContext context = AccessController.getContext(); + Subject subject = Subject.getSubject(context); + return subject; + } + +}