01: // HTTPPermission.java
02: // $Id: HTTPPermission.java,v 1.3 2000/08/16 21:37:33 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.acl;
07:
08: import java.security.acl.Permission;
09:
10: import org.w3c.jigsaw.http.Request;
11:
12: /**
13: * @version $Revision: 1.3 $
14: * @author Benoît Mahé (bmahe@w3.org)
15: */
16: public class HTTPPermission implements Permission {
17:
18: protected String method = null;
19:
20: protected String getMethod() {
21: return method;
22: }
23:
24: public HTTPPermission(Request request) {
25: this .method = request.getMethod();
26: }
27:
28: public boolean equals(Object another) {
29: if (another instanceof HTTPPermission) {
30: return method
31: .equals(((HTTPPermission) another).getMethod());
32: } else {
33: return method.equals(another.toString());
34: }
35: }
36:
37: public String toString() {
38: return method + " permission";
39: }
40:
41: }
|