001: package org.apache.turbine.om.security;
002:
003: /*
004: * Copyright 2001-2005 The Apache Software Foundation.
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License")
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import java.sql.Connection;
020: import org.apache.turbine.services.security.TurbineSecurity;
021: import org.apache.turbine.util.security.TurbineSecurityException;
022:
023: /**
024: * This class represents the permissions that a Role has to access
025: * certain pages/functions within the system. The class implements
026: * Comparable so that when Permissions are added to a Set, they will
027: * be in alphabetical order by name.
028: *
029: * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
030: * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
031: * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
032: * @version $Id: TurbinePermission.java 278822 2005-09-05 19:53:05Z henning $
033: */
034: public class TurbinePermission extends SecurityObject implements
035: Permission {
036: /** Serial Version UID */
037: private static final long serialVersionUID = -2193700445644560143L;
038:
039: /**
040: * Constructs a new TurbinePermission.
041: */
042: public TurbinePermission() {
043: super ();
044: }
045:
046: /**
047: * Constructs a new TurbinePermission with the sepcified name.
048: *
049: * @param name The name of the new object.
050: */
051: public TurbinePermission(String name) {
052: super (name);
053: }
054:
055: /**
056: * Makes changes made to the Permission attributes permanent.
057: *
058: * @throws TurbineSecurityException if there is a problem while saving data.
059: */
060: public void save() throws TurbineSecurityException {
061: TurbineSecurity.savePermission(this );
062: }
063:
064: /**
065: * not implemented
066: *
067: * @param conn
068: * @throws Exception
069: */
070: public void save(Connection conn) throws Exception {
071: throw new Exception("not implemented");
072: }
073:
074: /**
075: * not implemented
076: *
077: * @param dbname
078: * @throws Exception
079: */
080: public void save(String dbname) throws Exception {
081: throw new Exception("not implemented");
082: }
083:
084: /**
085: * Removes a permission from the system.
086: *
087: * @throws TurbineSecurityException if the Permission could not be removed.
088: */
089: public void remove() throws TurbineSecurityException {
090: TurbineSecurity.removePermission(this );
091: }
092:
093: /**
094: * Renames the permission.
095: *
096: * @param name The new Permission name.
097: * @throws TurbineSecurityException if the Permission could not be renamed.
098: */
099: public void rename(String name) throws TurbineSecurityException {
100: TurbineSecurity.renamePermission(this, name);
101: }
102: }
|