111 |
* |
* |
112 |
* @param name the name of the property |
* @param name the name of the property |
113 |
* @param actions the action string |
* @param actions the action string |
114 |
|
* @throws NullPointerException if name is null |
115 |
* @throws IllegalArgumentException if name string contains an |
* @throws IllegalArgumentException if name string contains an |
116 |
* illegal wildcard or actions string contains an illegal action |
* illegal wildcard or actions string contains an illegal action |
117 |
* (this includes a null actions string) |
* (this includes a null actions string) |
188 |
*/ |
*/ |
189 |
public boolean implies(Permission p) |
public boolean implies(Permission p) |
190 |
{ |
{ |
191 |
if (! (p instanceof PropertyPermission)) |
// BasicPermission checks for name and type. |
192 |
return false; |
if (super.implies(p)) |
193 |
|
{ |
194 |
// We have to check the actions. |
// We have to check the actions. |
195 |
PropertyPermission pp = (PropertyPermission) p; |
PropertyPermission pp = (PropertyPermission) p; |
196 |
if ((pp.actions & ~actions) != 0) |
return (pp.actions & ~actions) == 0; |
197 |
return false; |
} |
198 |
|
return false; |
|
// BasicPermission checks for name. |
|
|
return super.implies(p); |
|
199 |
} |
} |
200 |
|
|
201 |
/** |
/** |
208 |
*/ |
*/ |
209 |
public boolean equals(Object obj) |
public boolean equals(Object obj) |
210 |
{ |
{ |
211 |
if (! (obj instanceof PropertyPermission)) |
return super.equals(obj) && actions == ((PropertyPermission) obj).actions; |
|
return false; |
|
|
PropertyPermission p = (PropertyPermission) obj; |
|
|
return actions == p.actions && super.equals(p); |
|
212 |
} |
} |
213 |
|
|
214 |
/** |
/** |