View Javadoc

1   /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * 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.springframework.security.acls;
16  
17  import java.io.Serializable;
18  
19  import org.springframework.security.acls.sid.Sid;
20  
21  
22  /**
23   * A mutable <tt>Acl</tt>.
24   *
25   * <p>
26   * A mutable ACL must ensure that appropriate security checks are performed
27   * before allowing access to its methods.
28   * </p>
29   *
30   * @author Ben Alex
31   * @version $Id: MutableAcl.java 2872 2008-04-05 20:43:10Z benalex $
32   */
33  public interface MutableAcl extends Acl {
34      //~ Methods ========================================================================================================
35  
36      void deleteAce(int aceIndex) throws NotFoundException;
37  
38      /**
39       * Obtains an identifier that represents this <tt>MutableAcl</tt>.
40       *
41       * @return the identifier, or <tt>null</tt> if unsaved
42       */
43      Serializable getId();
44  
45      void insertAce(int atIndexLocation, Permission permission, Sid sid, boolean granting)
46          throws NotFoundException;
47  
48      /**
49       * Changes the present owner to a different owner.
50       * 
51       * @param newOwner the new owner (mandatory; cannot be null)
52       */
53      void setOwner(Sid newOwner);
54  
55      /**
56       * Change the value returned by {@link Acl#isEntriesInheriting()}.
57       *
58       * @param entriesInheriting the new value
59       */
60      void setEntriesInheriting(boolean entriesInheriting);
61  
62      /**
63       * Changes the parent of this ACL.
64       *
65       * @param newParent the new parent
66       */
67      void setParent(Acl newParent);
68  
69      void updateAce(int aceIndex, Permission permission)
70          throws NotFoundException;
71  }