< prev index next >

src/java.base/share/classes/java/security/AllPermission.java

Print this page




 195     /**
 196      * Check and see if this set of permissions implies the permissions
 197      * expressed in "permission".
 198      *
 199      * @param permission the Permission object to compare
 200      *
 201      * @return always returns true.
 202      */
 203 
 204     public boolean implies(Permission permission) {
 205         return all_allowed; // No sync; staleness OK
 206     }
 207 
 208     /**
 209      * Returns an enumeration of all the AllPermission objects in the
 210      * container.
 211      *
 212      * @return an enumeration of all the AllPermission objects.
 213      */
 214     public Enumeration<Permission> elements() {
 215         return new Enumeration<Permission>() {
 216             private boolean hasMore = all_allowed;
 217 
 218             public boolean hasMoreElements() {
 219                 return hasMore;
 220             }
 221 
 222             public Permission nextElement() {
 223                 hasMore = false;
 224                 return SecurityConstants.ALL_PERMISSION;
 225             }
 226         };
 227     }
 228 }


 195     /**
 196      * Check and see if this set of permissions implies the permissions
 197      * expressed in "permission".
 198      *
 199      * @param permission the Permission object to compare
 200      *
 201      * @return always returns true.
 202      */
 203 
 204     public boolean implies(Permission permission) {
 205         return all_allowed; // No sync; staleness OK
 206     }
 207 
 208     /**
 209      * Returns an enumeration of all the AllPermission objects in the
 210      * container.
 211      *
 212      * @return an enumeration of all the AllPermission objects.
 213      */
 214     public Enumeration<Permission> elements() {
 215         return new Enumeration<>() {
 216             private boolean hasMore = all_allowed;
 217 
 218             public boolean hasMoreElements() {
 219                 return hasMore;
 220             }
 221 
 222             public Permission nextElement() {
 223                 hasMore = false;
 224                 return SecurityConstants.ALL_PERMISSION;
 225             }
 226         };
 227     }
 228 }
< prev index next >