@Service @Singleton public class CommandSecurityChecker extends Object implements org.glassfish.hk2.api.PostConstruct
The processing includes AccessRequired
} annotations, CRUD commands,
RestEndpoint
annotations, and if the command
class implements AdminCommandSecurity.AccessCheckProvider
it also invokes the
corresponding getAccessChecks
method. To succeed the overall authorization
all access checks - whether inferred from annotations or returned from
getAccessChecks
- for which isFailureFatal
is true must pass.
Constructor and Description |
---|
CommandSecurityChecker() |
Modifier and Type | Method and Description |
---|---|
boolean |
authorize(Subject subject,
Map<String,Object> env,
AdminCommand command,
AdminCommandContext adminCommandContext)
Reports whether the Subject is allowed to perform the specified admin command.
|
Collection<? extends AccessRequired.AccessCheck> |
getAccessChecks(AdminCommand command,
Subject subject)
Returns all AccessCheck objects which apply to the specified command.
|
void |
postConstruct() |
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public boolean authorize(Subject subject, Map<String,Object> env, AdminCommand command, AdminCommandContext adminCommandContext) throws SecurityException
subject
- Subject for the current user to authorizeenv
- environmental settings that might be used in the resource name expressioncommand
- the admin command the Subject wants to executeSecurityException
public Collection<? extends AccessRequired.AccessCheck> getAccessChecks(AdminCommand command, Subject subject) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
command
- the AdminCommand for which the AccessChecks are neededsubject
- the Subject resulting from successful authenticationNoSuchFieldException
IllegalArgumentException
IllegalAccessException
Copyright © 2018. All rights reserved.