Skip to contentPackage: ACL
ACL
Coverage
1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package org.eclipse.angus.mail.imap;
18:
19: /**
20: * An access control list entry for a particular authentication identifier
21: * (user or group). Associates a set of Rights with the identifier.
22: * See RFC 2086.
23: * <p>
24: *
25: * @author Bill Shannon
26: */
27:
28: public class ACL implements Cloneable {
29:
30: private String name;
31: private Rights rights;
32:
33: /**
34: * Construct an ACL entry for the given identifier and with no rights.
35: *
36: * @param        name        the identifier name
37: */
38: public ACL(String name) {
39:         this.name = name;
40:         this.rights = new Rights();
41: }
42:
43: /**
44: * Construct an ACL entry for the given identifier with the given rights.
45: *
46: * @param        name        the identifier name
47: * @param        rights        the rights
48: */
49: public ACL(String name, Rights rights) {
50:         this.name = name;
51:         this.rights = rights;
52: }
53:
54: /**
55: * Get the identifier name for this ACL entry.
56: *
57: * @return        the identifier name
58: */
59: public String getName() {
60:         return name;
61: }
62:
63: /**
64: * Set the rights associated with this ACL entry.
65: *
66: * @param        rights        the rights
67: */
68: public void setRights(Rights rights) {
69:         this.rights = rights;
70: }
71:
72: /**
73: * Get the rights associated with this ACL entry.
74: * Returns the actual Rights object referenced by this ACL;
75: * modifications to the Rights object will effect this ACL.
76: *
77: * @return        the rights
78: */
79: public Rights getRights() {
80:         return rights;
81: }
82:
83: /**
84: * Clone this ACL entry.
85: */
86: @Override
87: public Object clone() throws CloneNotSupportedException {
88:         ACL acl = (ACL)super.clone();
89:         acl.rights = (Rights)this.rights.clone();
90:         return acl;
91: }
92: }