001    /*
002     * Copyright 2007 Ivan Dubrov
003     * Copyright 2007 Robin Helgelin
004     *
005     * Licensed under the Apache License, Version 2.0 (the "License");
006     * you may not use this file except in compliance with the License.
007     * You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package nu.localhost.tapestry5.springsecurity.services.internal;
019    
020    import org.springframework.security.intercept.InterceptorStatusToken;
021    
022    /**
023     * Interface that makes few methods from
024     * {@link org.springframework.security.intercept.AbstractSecurityInterceptor}
025     * public.
026     * 
027     * @author Ivan Dubrov
028     */
029    public interface SecurityChecker {
030        /**
031         * Check security before calling secured method.
032         * 
033         * @param object
034         *            security object
035         * @return status token
036         */
037        InterceptorStatusToken checkBefore(Object object);
038    
039        /**
040         * Check security after calling secured method.
041         * 
042         * @param token
043         *            status token
044         * @param returnedObject
045         *            object returned by the method
046         * @return object to return from the secured method
047         */
048        Object checkAfter(InterceptorStatusToken token, Object returnedObject);
049    }