128 |
public void checkPermission(Permission perm) throws AccessControlException |
public void checkPermission(Permission perm) throws AccessControlException |
129 |
{ |
{ |
130 |
if (protectionDomains.length == 0) |
if (protectionDomains.length == 0) |
131 |
throw new AccessControlException ("permission not granted"); |
throw new AccessControlException ("permission " |
132 |
|
+ perm |
133 |
|
+ " not granted: no protection domains"); |
134 |
|
|
135 |
for (int i = 0; i < protectionDomains.length; i++) |
for (int i = 0; i < protectionDomains.length; i++) |
136 |
if (!protectionDomains[i].implies(perm)) |
{ |
137 |
throw new AccessControlException ("permission not granted"); |
final ProtectionDomain domain = protectionDomains[i]; |
138 |
|
if (!domain.implies(perm)) |
139 |
|
throw new AccessControlException ("permission " |
140 |
|
+ perm |
141 |
|
+ " not granted: " |
142 |
|
+ domain |
143 |
|
+ " does not imply it."); |
144 |
|
} |
145 |
} |
} |
146 |
|
|
147 |
/** |
/** |