Este conteúdo não está disponível no idioma selecionado.

25.6. Authorization Using a SecurityManager


In Red Hat JBoss Data Grid's Remote Client-Server mode, authorization is able to work without a SecurityManager for basic cache operations. In Library mode, a SecurityManager may also be used to perform some of the more complex tasks, such as distexec and query among others.
In order to enforce access restrictions, enable the SecurityManager in your JVM using one of the following methods:
Command Line

java -Djava.security.manager ...
Copy to Clipboard Toggle word wrap

Programmaticaly

System.setSecurityManager(new SecurityManager());
Copy to Clipboard Toggle word wrap

Using the JDK's default implementation is not required; however, an appropriate policy file must be supplied. The policy file defines a set of permissions, which the SecurityManager examines when an application performs an action. If the action is allowed by the policy file, then the SecurityManager will permit the action to take place; however, if the action is not allowed by the policy then the SecurityManager denies that action.
An example policy file, demonstrating the required syntax, is below:
// If the code is signed by "admin", grant it read/write access to all files
grant signedBy "admin" {
    permission java.io.FilePermission "/*", "read,write";
};

// Grant everyone read permissions on specific environment variables:
grant {
    permission java.util.PropertyPermission "java.home", "read";
    permission java.util.PropertyPermission "java.class.path", "read";
    permission java.util.PropertyPermission "java.vendor", "read";
};

// Grant a specific codebase, example.jar, read and write access to "/tmp/*"
grant codeBase "file:///path/to/example.jar" {
    permission java.io.FilePermission "/tmp/*", "read,write";
};
Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat