Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.security.provider
Class AuthorizationPrincipalImpl

    java.lang.Object
      org.jasig.portal.security.provider.AuthorizationPrincipalImpl

All Implemented Interfaces:
  IAuthorizationPrincipal

    public class AuthorizationPrincipalImpl

extends java.lang.Object
implements IAuthorizationPrincipal

Version:
  $Revision: 1.9 $
Author:
  Dan Ellentuck

Field Summary
`private IAuthorizationService` | `authorizationService`
`private java.lang.String` | `key`
`private java.lang.String` | `principalString`
`private java.lang.Class` | `type`

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`.
`(package private) IAuthorizationService` | `getAuthorizationService()`
`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`.
`private void` | `initialize()` Set the value of the principal string.
`(package private) void` | `setAuthorizationService(IAuthorizationService newAuthorizationService)`
`java.lang.String` | `toString()` Returns a String that represents the value of this object.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### key

    private java.lang.String key

### type

    private java.lang.Class type

### authorizationService

    private IAuthorizationService authorizationService

### principalString

    private java.lang.String principalString

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.

  Overrides:
    `equals` in class `java.lang.Object`
  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.

### getAuthorizationService

    IAuthorizationService getAuthorizationService()

  Returns:
    org.jasig.portal.security.IAuthorization

### 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.

  Overrides:
    `hashCode` in class `java.lang.Object`
  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.

### initialize

    private void initialize()

  Set the value of the principal string.

### setAuthorizationService

    void setAuthorizationService(IAuthorizationService newAuthorizationService)

  Parameters:
    `newAuthorizationService` - org.jasig.portal.security.IAuthorizationService

### toString

    public java.lang.String toString()

  Returns a String that represents the value of this object.

  Overrides:
    `toString` in class `java.lang.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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD