001: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal.security;
007:
008: import java.util.Date;
009:
010: /**
011: * @author Bernie Durfee (bdurfee@interactivebusiness.com)
012: * @author Dan Ellentuck
013: * @version $Revision: 34783 $
014: */
015: public interface IPermission {
016: /*
017: Activity names for Permisisons whose targets are Channels.
018: */
019: public String CHANNEL_PUBLISHER_ACTIVITY = "PUBLISH";
020: public String CHANNEL_SUBSCRIBER_ACTIVITY = "SUBSCRIBE";
021: /*
022: Permisison types. At present only 2, but that could change.
023: */
024: public String PERMISSION_TYPE_GRANT = "GRANT";
025: public String PERMISSION_TYPE_DENY = "DENY";
026: /*
027: A String representing the uPortal framework, used, for example, for
028: Permission.owner when the framework grants a Permission.
029: */
030: public String PORTAL_FRAMEWORK = "UP_FRAMEWORK";
031: /*
032: A String which, when concatentated with a channel id, represents a portal
033: channel. Used, for example, for Permission.target when the portal framework
034: grants a Permission to perform some activity on a channel.
035: */
036: public String CHANNEL_PREFIX = "CHAN_ID.";
037:
038: /**
039: * Gets the activity associated with this <code>IPermission</code>.
040: * @return String
041: */
042:
043: public String getActivity();
044:
045: /**
046: * Gets that date that this <code>IPermission</code> should become effective on.
047: * @return date that this <code>IPermission</code> should become effective on
048: */
049: public Date getEffective();
050:
051: /**
052: * Gets the date that this <code>IPermission</code> should expire on.
053: * @return date that this <code>IPermission</code> should expire on
054: */
055: public Date getExpires();
056:
057: /**
058: * Returns the owner of this <code>IPermission</code>.
059: * @return owner of this <code>IPermission</code>
060: */
061: public String getOwner();
062:
063: /**
064: * Gets the target associated with this <code>IPermission</code>.
065: * @return target associated with this <code>IPermission</code>
066: */
067: public String getTarget();
068:
069: /**
070: * Returns the <code>Permission</code> type.
071: */
072: public String getType();
073:
074: /**
075: * Sets the activity associated with this <code>IPermission</code>.
076: * @param activity String
077: */
078: public void setActivity(String activity);
079:
080: /**
081: * Sets the date that this <code>IPermission</code> should become effective on.
082: * @param effective java.util.Date
083: */
084: public void setEffective(Date effective);
085:
086: /**
087: * Sets the date that this <code>IPermission</code> should expire on.
088: * @param expires java.util.Date
089: */
090: public void setExpires(Date expires);
091:
092: /**
093: * Sets the target associated with this <code>IPermission</code>.
094: * @param target
095: */
096: public void setTarget(String target);
097:
098: /**
099: * Sets the <code>IPermission</code> type.
100: * @param type String
101: */
102: public abstract void setType(String type);
103:
104: /**
105: * Returns a String representing the <code>IAuthorizationPrincipal</code> associated
106: * with this <code>IPermission</code>.
107: * @return IAuthorizationPrincipal associated with this IPermission
108: */
109: public String getPrincipal();
110:
111: /**
112: * Sets the principal String representing the <code>IAuthorizationPrincipal</code>
113: * associated with this <code>IPermission</code>.
114: * @param newPrincipal String
115: */
116: public void setPrincipal(String newPrincipal);
117: }
|