01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15: package org.acegisecurity.acls;
16:
17: import org.acegisecurity.acls.sid.Sid;
18:
19: import java.io.Serializable;
20:
21: /**
22: * A mutable <code>Acl</code>.
23: *
24: * <p>
25: * A mutable ACL must ensure that appropriate security checks are performed
26: * before allowing access to its methods.
27: * </p>
28: *
29: * @author Ben Alex
30: * @version $Id: MutableAcl.java 1867 2007-05-25 02:22:18Z benalex $
31: */
32: public interface MutableAcl extends Acl {
33: //~ Methods ========================================================================================================
34:
35: void deleteAce(Serializable aceId) throws NotFoundException;
36:
37: /**
38: * Retrieves all of the non-deleted {@link AccessControlEntry} instances currently stored by the
39: * <code>MutableAcl</code>. The returned objects should be immutable outside the package, and therefore it is safe
40: * to return them to the caller for informational purposes. The <code>AccessControlEntry</code> information is
41: * needed so that invocations of update and delete methods on the <code>MutableAcl</code> can refer to a valid
42: * {@link AccessControlEntry#getId()}.
43: *
44: * @return DOCUMENT ME!
45: */
46: AccessControlEntry[] getEntries();
47:
48: /**
49: * Obtains an identifier that represents this <code>MutableAcl</code>.
50: *
51: * @return the identifier, or <code>null</code> if unsaved
52: */
53: Serializable getId();
54:
55: void insertAce(Serializable afterAceId, Permission permission,
56: Sid sid, boolean granting) throws NotFoundException;
57:
58: /**
59: * Change the value returned by {@link Acl#isEntriesInheriting()}.
60: *
61: * @param entriesInheriting the new value
62: */
63: void setEntriesInheriting(boolean entriesInheriting);
64:
65: /**
66: * Changes the parent of this ACL.
67: *
68: * @param newParent the new parent
69: */
70: void setParent(Acl newParent);
71:
72: void updateAce(Serializable aceId, Permission permission)
73: throws NotFoundException;
74: }
|