alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (Comparator.Combined.Policy)

This example Java source code file (Comparator.Combined.Policy) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

comparator, pcompare1, pcompare2, pcompare3

The Comparator.Combined.Policy Java example source code


// should be granted
grant principal com.sun.security.auth.UnixPrincipal "1",
    principal Comparator$PCompare2 "2" {
    permission java.util.PropertyPermission "foo", "read";
};

// should be granted
grant principal Comparator$PCompare1 "1",
    principal com.sun.security.auth.NTUserPrincipal "4" {
    permission java.util.PropertyPermission "bar", "read";
};

// should be granted
grant principal com.sun.security.auth.UnixPrincipal "1",
    principal javax.security.auth.x500.X500Principal "cn=x500",
    principal Comparator$PCompare2 "2" {
    permission java.util.PropertyPermission "hello", "read";
};

// should be granted
grant principal Comparator$PCompare1 "1",
    principal com.sun.security.auth.NTUserPrincipal "4",
    principal javax.security.auth.x500.X500Principal "cn=x500" {
    permission java.util.PropertyPermission "world", "read";
};

// should not be granted
grant principal Comparator$PCompare1 "1",
    principal Comparator$PCompare3 "3" {
    permission java.util.PropertyPermission "foobar", "read";
};

Other Java examples (source code examples)

Here is a short list of links related to this Java Comparator.Combined.Policy source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.