@Override public boolean hasPermission( ExecutionContext context, String repositoryName, String repositorySourceName, String workspaceName, Path absPath, String... actions ) { if (absPath == null) { // we'll let all authenticated users to have rights on the workspaces return true; } try { // we don't care about the resource, this is just a simple example which checks the roles of the subject // against the configured roles in the configuration file authorizationManager.authorize(new POJOResource(absPath), this.authenticatedSubject); return true; } catch (AuthorizationException e) { return false; } }
try int check = authzManager.authorize(resource); isAuthorized = (check == AuthorizationContext.PERMIT);
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); hasTheRole = (permit == AuthorizationContext.PERMIT); String level = (hasTheRole ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); hasPerm = (permit == AuthorizationContext.PERMIT); String level = (hasPerm ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT);
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); isAuthorized = (permit == AuthorizationContext.PERMIT); String level = (permit == AuthorizationContext.PERMIT ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
try int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT); authorizationAudit((isAuthorized ? AuditLevel.SUCCESS : AuditLevel.FAILURE)
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); hasTheRole = (permit == AuthorizationContext.PERMIT); String level = (hasTheRole ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
try int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT); authorizationAudit((isAuthorized ? AuditLevel.SUCCESS : AuditLevel.FAILURE)
int permit = authzMgr.authorize(new POJOResource(pojo), subject, roles); if(permit != AuthorizationContext.PERMIT) throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage());
int permit = authzMgr.authorize(new POJOResource(pojo), subject, roles); if(permit != AuthorizationContext.PERMIT) throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage());
int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT);
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); hasPerm = (permit == AuthorizationContext.PERMIT); String level = (hasPerm ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
int permit = authzMgr.authorize(webResource, callerSubject, callerRoles); isAuthorized = (permit == AuthorizationContext.PERMIT); String level = (permit == AuthorizationContext.PERMIT ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT);
try int check = am.authorize(ejbResource, callerSubject, callerRoles); isAuthorized = (check == AuthorizationContext.PERMIT); authorizationAudit((isAuthorized ? AuditLevel.SUCCESS : AuditLevel.FAILURE)