| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
| MutableAcl |
|
| 1.0;1 |
| 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.acegisecurity.acls; |
|
| 16 | ||
| 17 | import org.acegisecurity.acls.sid.Sid; |
|
| 18 | ||
| 19 | import java.io.Serializable; |
|
| 20 | ||
| 21 | ||
| 22 | /** |
|
| 23 | * A mutable <code>Acl</code>. |
|
| 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 1867 2007-05-25 02:22:18Z benalex $ |
|
| 32 | */ |
|
| 33 | public interface MutableAcl extends Acl { |
|
| 34 | //~ Methods ======================================================================================================== |
|
| 35 | ||
| 36 | void deleteAce(Serializable aceId) throws NotFoundException; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Retrieves all of the non-deleted {@link AccessControlEntry} instances currently stored by the |
|
| 40 | * <code>MutableAcl</code>. The returned objects should be immutable outside the package, and therefore it is safe |
|
| 41 | * to return them to the caller for informational purposes. The <code>AccessControlEntry</code> information is |
|
| 42 | * needed so that invocations of update and delete methods on the <code>MutableAcl</code> can refer to a valid |
|
| 43 | * {@link AccessControlEntry#getId()}. |
|
| 44 | * |
|
| 45 | * @return DOCUMENT ME! |
|
| 46 | */ |
|
| 47 | AccessControlEntry[] getEntries(); |
|
| 48 | ||
| 49 | /** |
|
| 50 | * Obtains an identifier that represents this <code>MutableAcl</code>. |
|
| 51 | * |
|
| 52 | * @return the identifier, or <code>null</code> if unsaved |
|
| 53 | */ |
|
| 54 | Serializable getId(); |
|
| 55 | ||
| 56 | void insertAce(Serializable afterAceId, Permission permission, Sid sid, boolean granting) |
|
| 57 | throws NotFoundException; |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Change the value returned by {@link Acl#isEntriesInheriting()}. |
|
| 61 | * |
|
| 62 | * @param entriesInheriting the new value |
|
| 63 | */ |
|
| 64 | void setEntriesInheriting(boolean entriesInheriting); |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Changes the parent of this ACL. |
|
| 68 | * |
|
| 69 | * @param newParent the new parent |
|
| 70 | */ |
|
| 71 | void setParent(Acl newParent); |
|
| 72 | ||
| 73 | void updateAce(Serializable aceId, Permission permission) |
|
| 74 | throws NotFoundException; |
|
| 75 | } |