uPortal 2.4.1
API Documentation

org.jasig.portal.security.provider
Class AuthorizationPrincipalImpl

java.lang.Object
  extended byorg.jasig.portal.security.provider.AuthorizationPrincipalImpl
All Implemented Interfaces:
IAuthorizationPrincipal

public class AuthorizationPrincipalImpl
extends java.lang.Object
implements IAuthorizationPrincipal

Version:
$Revision: 1.8 $
Author:
Dan Ellentuck

Constructor Summary
AuthorizationPrincipalImpl(java.lang.String newKey, java.lang.Class newType)
          Constructor for ReferenceAuthorizationPrincipal.
AuthorizationPrincipalImpl(java.lang.String newKey, java.lang.Class newType, IAuthorizationService authService)
          Constructor for ReferenceAuthorizationPrincipal.
 
Method Summary
 boolean canPublish()
          Answers if this IAuthorizationPrincipal has permission to publish.
 boolean canRender(int channelPublishId)
          Answers if this IAuthorizationPrincipal has permission to render this channel.
 boolean canSubscribe(int channelPublishId)
          Answers if this IAuthorizationPrincipal has permission to subscribe to this channel.
 boolean equals(java.lang.Object obj)
          Compares two objects for equality.
 IPermission[] getAllPermissions()
          Returns the IPermissions for this IAuthorizationPrincipal, including inherited IPermissions.
 IPermission[] getAllPermissions(java.lang.String owner, java.lang.String activity, java.lang.String target)
          Returns the IPermissions for this IAuthorizationPrincipal for the specified owner, activity and target.
 java.util.Vector getAuthorizedChannels()
          Return a Vector of IChannels.
 java.lang.String getKey()
          Returns the key of the underlying entity.
 IPermission[] getPermissions()
          Returns the IPermissions for this IAuthorizationPrincipal.
 IPermission[] getPermissions(java.lang.String owner, java.lang.String activity, java.lang.String target)
          Returns the IPermissions for this IAuthorizationPrincipal for the specified owner, activity and target.
 java.lang.String getPrincipalString()
           
 java.lang.Class getType()
          Return the Type of the underlying entity.
 int hashCode()
          Generates a hash code for the receiver.
 boolean hasPermission(java.lang.String owner, java.lang.String activity, java.lang.String target)
          Answers if this IAuthorizationPrincipal has permission to perform the activity on the target.
 boolean hasPermission(java.lang.String owner, java.lang.String activity, java.lang.String target, IPermissionPolicy policy)
          Answers if this IAuthorizationPrincipal has permission to perform the activity on the target, as evaluated by the policy.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthorizationPrincipalImpl

public AuthorizationPrincipalImpl(java.lang.String newKey,
                                  java.lang.Class newType)
Constructor for ReferenceAuthorizationPrincipal.


AuthorizationPrincipalImpl

public AuthorizationPrincipalImpl(java.lang.String newKey,
                                  java.lang.Class newType,
                                  IAuthorizationService authService)
Constructor for ReferenceAuthorizationPrincipal.

Method Detail

canPublish

public boolean canPublish()
                   throws AuthorizationException
Answers if this IAuthorizationPrincipal has permission to publish.

Specified by:
canPublish in interface IAuthorizationPrincipal
Returns:
boolean
Throws:
AuthorizationException - thrown when authorization information could not be retrieved.

canRender

public boolean canRender(int channelPublishId)
                  throws AuthorizationException
Answers if this IAuthorizationPrincipal has permission to render this channel.

Specified by:
canRender in interface IAuthorizationPrincipal
Parameters:
channelPublishId - int - the Channel publish ID
Returns:
boolean
Throws:
AuthorizationException - thrown when authorization information could not be retrieved.

canSubscribe

public boolean canSubscribe(int channelPublishId)
                     throws AuthorizationException
Answers if this IAuthorizationPrincipal has permission to subscribe to this channel.

Specified by:
canSubscribe in interface IAuthorizationPrincipal
Parameters:
channelPublishId - int - the Channel publish ID
Returns:
boolean
Throws:
AuthorizationException - thrown when authorization information could not be retrieved.

equals

public boolean equals(java.lang.Object obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable

getAllPermissions

public IPermission[] getAllPermissions()
                                throws AuthorizationException
Returns the IPermissions for this IAuthorizationPrincipal, including inherited IPermissions.

Specified by:
getAllPermissions in interface IAuthorizationPrincipal
Returns:
org.jasig.portal.security.IPermission[]
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

getAllPermissions

public IPermission[] getAllPermissions(java.lang.String owner,
                                       java.lang.String activity,
                                       java.lang.String target)
                                throws AuthorizationException
Returns the IPermissions for this IAuthorizationPrincipal for the specified owner, activity and target. Inherited IPermissions are included. Null parameters are ignored, so getPermissions(null, null, null) should retrieve all IPermissions for an IAuthorizationPrincipal.

Specified by:
getAllPermissions in interface IAuthorizationPrincipal
Parameters:
owner - java.lang.String
activity - java.lang.String
target - java.lang.String
Returns:
org.jasig.portal.security.IPermission[]
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

getAuthorizedChannels

public java.util.Vector getAuthorizedChannels()
                                       throws AuthorizationException
Return a Vector of IChannels.

Specified by:
getAuthorizedChannels in interface IAuthorizationPrincipal
Returns:
a java.util.Vector of IChannels
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

getKey

public java.lang.String getKey()
Description copied from interface: IAuthorizationPrincipal
Returns the key of the underlying entity.

Specified by:
getKey in interface IAuthorizationPrincipal
Returns:
java.lang.String

getPermissions

public IPermission[] getPermissions()
                             throws AuthorizationException
Returns the IPermissions for this IAuthorizationPrincipal.

Specified by:
getPermissions in interface IAuthorizationPrincipal
Returns:
org.jasig.portal.security.IPermission[]
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

getPermissions

public IPermission[] getPermissions(java.lang.String owner,
                                    java.lang.String activity,
                                    java.lang.String target)
                             throws AuthorizationException
Returns the IPermissions for this IAuthorizationPrincipal for the specified owner, activity and target. Null parameters are ignored, so getPermissions(null, null, null) should retrieve all IPermissions for an IAuthorizationPrincipal.

Specified by:
getPermissions in interface IAuthorizationPrincipal
Parameters:
owner - java.lang.String
activity - java.lang.String
target - java.lang.String
Returns:
org.jasig.portal.security.IPermission[]
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

getPrincipalString

public java.lang.String getPrincipalString()
Specified by:
getPrincipalString in interface IAuthorizationPrincipal
Returns:
java.lang.String

getType

public java.lang.Class getType()
Description copied from interface: IAuthorizationPrincipal
Return the Type of the underlying entity.

Specified by:
getType in interface IAuthorizationPrincipal
Returns:
java.lang.Class

hashCode

public int hashCode()
Generates a hash code for the receiver. This method is supported primarily for hash tables, such as those provided in java.util.

Returns:
an integer hash code for the receiver
See Also:
Hashtable

hasPermission

public boolean hasPermission(java.lang.String owner,
                             java.lang.String activity,
                             java.lang.String target)
                      throws AuthorizationException
Answers if this IAuthorizationPrincipal has permission to perform the activity on the target. Params owner and activity must be non-null. If target is null, then the target is not checked.

Specified by:
hasPermission in interface IAuthorizationPrincipal
Parameters:
owner - java.lang.String
activity - java.lang.String
target - java.lang.String
Returns:
boolean
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

toString

public java.lang.String toString()
Returns a String that represents the value of this object.

Returns:
a string representation of the receiver

hasPermission

public boolean hasPermission(java.lang.String owner,
                             java.lang.String activity,
                             java.lang.String target,
                             IPermissionPolicy policy)
                      throws AuthorizationException
Answers if this IAuthorizationPrincipal has permission to perform the activity on the target, as evaluated by the policy. Params policy, owner and activity must be non-null.

Specified by:
hasPermission in interface IAuthorizationPrincipal
Parameters:
owner - java.lang.String
activity - java.lang.String
target - java.lang.String
policy - org.jasig.portal.security.IPermissionPolicy
Returns:
boolean
Throws:
AuthorizationException - indicates authorization information could not be retrieved.

uPortal 2.4.1
API Documentation