90 * @see Permissions
91 *
92 *
93 * @author Roland Schemers
94 * @since 1.2
95 */
96
97 public abstract class PermissionCollection implements java.io.Serializable {
98
99 @java.io.Serial
100 private static final long serialVersionUID = -6727011328946861783L;
101
102 // when set, add will throw an exception.
103 private volatile boolean readOnly;
104
105 /**
106 * Adds a permission object to the current collection of permission objects.
107 *
108 * @param permission the Permission object to add.
109 *
110 * @exception SecurityException - if this PermissionCollection object
111 * has been marked readonly
112 * @exception IllegalArgumentException - if this PermissionCollection
113 * object is a homogeneous collection and the permission
114 * is not of the correct type.
115 */
116 public abstract void add(Permission permission);
117
118 /**
119 * Checks to see if the specified permission is implied by
120 * the collection of Permission objects held in this PermissionCollection.
121 *
122 * @param permission the Permission object to compare.
123 *
124 * @return true if "permission" is implied by the permissions in
125 * the collection, false if not.
126 */
127 public abstract boolean implies(Permission permission);
128
129 /**
130 * Returns an enumeration of all the Permission objects in the collection.
131 *
132 * @return an enumeration of all the Permissions.
|
90 * @see Permissions
91 *
92 *
93 * @author Roland Schemers
94 * @since 1.2
95 */
96
97 public abstract class PermissionCollection implements java.io.Serializable {
98
99 @java.io.Serial
100 private static final long serialVersionUID = -6727011328946861783L;
101
102 // when set, add will throw an exception.
103 private volatile boolean readOnly;
104
105 /**
106 * Adds a permission object to the current collection of permission objects.
107 *
108 * @param permission the Permission object to add.
109 *
110 * @throws SecurityException - if this PermissionCollection object
111 * has been marked readonly
112 * @throws IllegalArgumentException - if this PermissionCollection
113 * object is a homogeneous collection and the permission
114 * is not of the correct type.
115 */
116 public abstract void add(Permission permission);
117
118 /**
119 * Checks to see if the specified permission is implied by
120 * the collection of Permission objects held in this PermissionCollection.
121 *
122 * @param permission the Permission object to compare.
123 *
124 * @return true if "permission" is implied by the permissions in
125 * the collection, false if not.
126 */
127 public abstract boolean implies(Permission permission);
128
129 /**
130 * Returns an enumeration of all the Permission objects in the collection.
131 *
132 * @return an enumeration of all the Permissions.
|