01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.security;
07:
08: import org.jasig.portal.AuthorizationException;
09:
10: /**
11: * An interface for retrieving <code>IAuthorizationPrincipals</code> and
12: * their <code>Permissions</code> on behalf of a <code>Permission</code> owner.
13: *
14: * @author Dan Ellentuck
15: * @version $Revision: 34783 $
16: */
17: public interface IPermissionManager {
18: /**
19: * Returns <code>IPermissions</code> granted to the <code>IAuthorizationPrincipal</code>
20: * by the owner of this <code>IPermissionManager</code>, for the given <code>activity</code>
21: * and <code>target</code>. This includes inherited <code>IPermissions</code>. If any
22: * parameter is null, it is ignored.
23: *
24: * @return IPermission[]
25: * @param principal IAuthorizationPrincipal
26: * @param activity String - the Permission activity
27: * @param target String - the Permission target
28: */
29: public IPermission[] getAllPermissions(
30: IAuthorizationPrincipal principal, String activity,
31: String target) throws AuthorizationException;
32:
33: /**
34: * Returns <code>IAuthorizationPrincipals</code> granted <code>Permissions</code>
35: * by the owner of this <code>IPermissionManager</code>, for the given <code>activity</code>
36: * and <code>target</code>. If either parameter is null, it is ignored.
37: *
38: * @return IAuthorizationPrincipal[]
39: * @param activity String - the Permission activity
40: * @param target String - the Permission target
41: */
42: public IAuthorizationPrincipal[] getAuthorizedPrincipals(
43: String activity, String target)
44: throws AuthorizationException;
45:
46: /**
47: * @return java.lang.String
48: */
49: public String getOwner();
50:
51: /**
52: * Retrieve an array of IPermission objects based on the given parameters. Any null parameters
53: * will be ignored.
54: *
55: * @param activity String
56: * @param target String
57: * @return Permission[]
58: * @exception AuthorizationException
59: */
60: public IPermission[] getPermissions(String activity, String target)
61: throws AuthorizationException;
62:
63: /**
64: * Returns <code>IPermissions</code> granted to the <code>IAuthorizationPrincipal</code>
65: * by the owner of this <code>IPermissionManager</code>, for the given <code>activity</code>
66: * and <code>target</code>. If any parameter is null, it is ignored.
67: *
68: * @return IPermission[]
69: * @param principal IAuthorizationPrincipal
70: * @param activity String - the Permission activity
71: * @param target String - the Permission target
72: */
73: public IPermission[] getPermissions(
74: IAuthorizationPrincipal principal, String activity,
75: String target) throws AuthorizationException;
76: }
|