Package org.glassfish.api.admin
Annotation Interface AccessRequired
Allows command developers to declare what resources are affected by the command and what actions must be authorized
on each to allow the command to execute.
Use any or all of the following to control authorization:
- Use the
@AccessRequiredannotation at the class level to declare a resource name and action to be enforced; use@AccessRequired.Listto declare more than one combination of resources and actions. - Use the
@AccessRequired.Toannotation on a field that is a ConfigBean to declare one or more actions to be enforced on the resource derived from that config bean. - Have the command class implement
@AccessRequired.Authorizerwhich prescribes theisAuthorizedmethod that will make authorization decisions internally, without help from the command framework.
@AccessRequired annotations and subannotations and make sure all of them
pass before allowing the command to proceed.- Author:
- tjquinn
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an authorization check: a resource and an action to be authorized on that resource.static @interfacestatic @interfaceDeclares multiple class-level@AccessRequiredauthorization steps, typically each identifying different resources and/or different actionsstatic @interfaceDeclares access control for creating a new childConfigBeanin a collection on an existingConfigBean.static @interfaceDeclares access control on an existing, non-nullConfigBean.static classUtility methods used both from AccessCheck and from CommandSecurityChecker. -
Required Element Summary
Required Elements
-
Element Details
-
resource
String[] resourceName(s) of the resource(s) to which access should be checked. The name string can contain one or more tokens of the form ${fieldName} where "fieldName" is a field on the same command class (or a superclass) that contains a non-null value. If the referenced field is a ConfigBean then at runtime the resource name of that ConfigBean replaces the token. Otherwise the field'stoString()return value replaces the token. -
action
String[] actionOne or more actions to authorize against the named resource.
-