001: /******************************************************************************
002: * JBoss, a division of Red Hat *
003: * Copyright 2006, Red Hat Middleware, LLC, and individual *
004: * contributors as indicated by the @authors tag. See the *
005: * copyright.txt in the distribution for a full listing of *
006: * individual contributors. *
007: * *
008: * This is free software; you can redistribute it and/or modify it *
009: * under the terms of the GNU Lesser General Public License as *
010: * published by the Free Software Foundation; either version 2.1 of *
011: * the License, or (at your option) any later version. *
012: * *
013: * This software is distributed in the hope that it will be useful, *
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
016: * Lesser General Public License for more details. *
017: * *
018: * You should have received a copy of the GNU Lesser General Public *
019: * License along with this software; if not, write to the Free *
020: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
021: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
022: ******************************************************************************/package org.jboss.portal.cms.security;
023:
024: import org.jboss.portal.security.PortalPermission;
025: import org.jboss.portal.security.PortalSecurityException;
026: import org.jboss.portal.security.spi.provider.PermissionRepository;
027:
028: import javax.security.auth.Subject;
029:
030: /**
031: * Created on : Jan 23, 2007
032: *
033: * @author Sohil Shah - sohil.shah@jboss.com
034: */
035: public class CMSPermission extends PortalPermission {
036: private PortalCMSSecurityContext securityContext = null;
037:
038: /**
039: *
040: */
041: public CMSPermission(String name, String uri) {
042: super (name, uri);
043: }
044:
045: /** @param wrappedPermission */
046: public CMSPermission(PortalCMSSecurityContext securityContext) {
047: super ("", "");
048: this .securityContext = securityContext;
049: }
050:
051: //--------PortalPermission implementation------------------------------------------------------------
052: /**
053: *
054: */
055: public String getType() {
056: return this .getClass().getName();
057: }
058:
059: /**
060: *
061: */
062: public boolean implies(PermissionRepository repository,
063: Subject caller, String roleName, PortalPermission permission)
064: throws PortalSecurityException {
065: return false;
066: }
067:
068: /** @return */
069: public PortalCMSSecurityContext getSecurityContext() {
070: return this .securityContext;
071: }
072:
073: //-------Permission implementation------------------------------------------------------------------
074: /**
075: *
076: */
077: public boolean equals(Object obj) {
078: return false;
079: }
080:
081: /**
082: *
083: */
084: public String getActions() {
085: return null;
086: }
087:
088: /**
089: *
090: */
091: public int hashCode() {
092: return 0;
093: }
094:
095: /**
096: *
097: */
098: public boolean implies(java.security.Permission permission) {
099: return false;
100: }
101: }
|