comparison servlet/src/digilib/auth/AuthOps.java @ 72:300d5ba8b33b

New servlet version 1.5b. Mostly cleanup. Global parameters for digilib now in DigilibConfiguration, per request parameters are now all in DigilibRequest. The DocuImage implementation can be selected by the configuration docuimage-class. Pixel-by-pixel view implemented with "mo=clip".
author robcast
date Fri, 24 Jan 2003 21:40:59 +0100
parents 0ff3ede32060
children e758a49258e8
comparison
equal deleted inserted replaced
71:d493563ef672 72:300d5ba8b33b
18 18
19 */ 19 */
20 20
21 package digilib.auth; 21 package digilib.auth;
22 22
23 import java.util.List;
23 24
24 import java.io.*; 25 import javax.servlet.http.HttpServletRequest;
25 import java.util.*;
26 import javax.servlet.http.*;
27 26
27 import digilib.servlet.DigilibRequest;
28
29 /** Class of operations requiring authentication. */
28 public interface AuthOps { 30 public interface AuthOps {
29 31
30 /** 32 /** Test if the request must be authorized to access the filepath.
31 * check if the request must be authorized to access filepath 33 *
32 */ 34 * Information about the user is taken from the ServletRequest.
33 public boolean isAuthRequired(String filepath, HttpServletRequest request) throws AuthOpException; 35 * @param filepath filepath to be accessed.
36 * @param request ServletRequest with user information.
37 * @throws AuthOpException Exception thrown on error.
38 * @return true if the user request must be authorized.
39 */
40 public boolean isAuthRequired(String filepath, HttpServletRequest request)
41 throws AuthOpException;
34 42
35 /** 43 /** Test if the request must be authorized to access the filepath.
36 * check if the request is allowed to access filepath 44 *
37 */ 45 * Information about the user is taken from the DigilibRequest.
38 public boolean isAuthorized(String filepath, HttpServletRequest request) throws AuthOpException; 46 * @param request DigilibRequest with user information.
47 * @throws AuthOpException Exception thrown on error.
48 * @return true if the user request must be authorized.
49 */
50 public boolean isAuthRequired(DigilibRequest request)
51 throws AuthOpException;
39 52
40 /** 53 /** Test if the request is allowed to access filepath.
41 * return a list of authorization roles needed for request 54 *
42 * to access the specified path 55 * @param filepath filepath to be acessed.
43 * (does not look at request address for now) 56 * @param request Request with user information.
44 */ 57 * @throws AuthOpException Exception thrown on error.
45 public List rolesForPath(String filepath, HttpServletRequest request) throws AuthOpException; 58 * @return true if the request is allowed.
59 */
60 public boolean isAuthorized(String filepath, HttpServletRequest request)
61 throws AuthOpException;
46 62
47 /** 63 /** Test if the request is allowed to access filepath.
48 * check request authorization against a list of roles 64 *
49 */ 65 * @param request Request with user information.
50 public boolean isRoleAuthorized(List roles, HttpServletRequest request); 66 * @throws AuthOpException Exception thrown on error.
67 * @return true if the request is allowed.
68 */
69 public boolean isAuthorized(DigilibRequest request)
70 throws AuthOpException;
71
72 /** Authorization roles needed for request.
73 *
74 * Returns the list of authorization roles that are needed to access the
75 * specified path. No list means the path is free.
76 *
77 * The location information of the request is also considered.
78 *
79 * @param filepath filepath to be accessed.
80 * @param request ServletRequest with address information.
81 * @throws AuthOpException Exception thrown on error.
82 * @return List of Strings with role names.
83 */
84 public List rolesForPath(String filepath, HttpServletRequest request)
85 throws AuthOpException;
86
87 /** Authorization roles needed for request.
88 *
89 * Returns the list of authorization roles that are needed to access the
90 * specified path. No list means the path is free.
91 *
92 * The location information of the request is also considered.
93 *
94 * @param request DigilibRequest with address information.
95 * @throws AuthOpException Exception thrown on error.
96 * @return List of Strings with role names.
97 */
98 public List rolesForPath(DigilibRequest request)
99 throws AuthOpException;
100
101 /** Test request authorization against a list of roles.
102 * @param roles List of Strings with role names.
103 * @param request ServletRequest with address information.
104 * @return true if the user information in the request authorizes one of the roles.
105 */
106 public boolean isRoleAuthorized(List roles, HttpServletRequest request);
107
108 /** Test request authorization against a list of roles.
109 * @param roles List of Strings with role names.
110 * @param request ServletRequest with address information.
111 * @return true if the user information in the request authorizes one of the roles.
112 */
113 public boolean isRoleAuthorized(List roles, DigilibRequest request);
51 114
52 } 115 }