@Override public synchronized void unlock( String tokenId, LockableResource r ) throws NotAuthorizedException { FsResource resource = (FsResource) r; LockToken lockToken = currentLock( resource ); if( lockToken == null ) { log.debug( "not locked" ); return; } if( lockToken.tokenId.equals( tokenId ) ) { removeLock( lockToken ); } else { throw new NotAuthorizedException( resource ); } }
@Override public synchronized void unlock(String tokenId, LockableResource r) throws NotAuthorizedException { LockToken lockToken = currentLock(r.getUniqueId()); if (lockToken == null) { log.debug("not locked"); return; } if (lockToken.tokenId.equals(tokenId)) { removeLock(lockToken); } else { throw new NotAuthorizedException("Non-matching tokens: " + tokenId + " != " + lockToken.tokenId, r); } }
if (authStatus == null) { log.trace("Authentication not attempted"); throw new NotAuthorizedException(res); } else { if (authStatus.loginFailed) { log.warn("Early authentication failed"); throw new NotAuthorizedException(res); } else { log.trace("Early authentication succeeded");
NotAuthorizedException nae = (NotAuthorizedException)cause; if( nae.getResource() == null ) { throw new NotAuthorizedException(sourceRes, nae); // need exception with resource so we can generate challenge
public PropFindResponse doPropPatch(Request request, Resource resource, PropPatchSetter propPatchSetter) throws NotAuthorizedException, IOException, BadRequestException, ConflictException { InputStream in = request.getInputStream(); PropPatchParseResult parseResult = requestParser.getRequestedFields(in); // Check that the current user has permission to write requested fields Set<QName> allFields = getAllFields(parseResult); if (log.isTraceEnabled()) { log.trace("check permissions with: " + permissionService.getClass().getCanonicalName()); } Set<PropertyAuthoriser.CheckResult> errorFields = permissionService.checkPermissions(request, request.getMethod(), PropertyAuthoriser.PropertyPermission.WRITE, allFields, resource); if (errorFields != null && errorFields.size() > 0) { throw new NotAuthorizedException(resource); } String href = request.getAbsoluteUrl(); href = DefaultPropFindPropertyBuilder.fixUrlForWindows(href); PropFindResponse resp = propPatchSetter.setProperties(href, parseResult, resource); return resp; }
throw new NotAuthorizedException(wrappedResource); } else { LogUtils.trace(log, "setting properties with", patchSetter.getClass());
throw new NotAuthorizedException("Authentication is required for write access", parent); } else { boolean allowsHead = parent.authorise(request, Method.HEAD, null); if (!allowsHead) { throw new NotAuthorizedException("Authentication is required for read access", parent);
MakeCollectionableResource mkcol = (MakeCollectionableResource) parent; if (!handlerHelper.checkAuthorisation(manager, mkcol, request)) { throw new NotAuthorizedException(mkcol);
throw new BadRequestException(href); case 401: throw new NotAuthorizedException(href, null); case 403: throw new NotAuthorizedException(href, null); case 404: throw new NotFoundException(href);