当前位置: 首页>>代码示例>>Java>>正文


Java AccessDeniedException类代码示例

本文整理汇总了Java中org.acegisecurity.AccessDeniedException的典型用法代码示例。如果您正苦于以下问题:Java AccessDeniedException类的具体用法?Java AccessDeniedException怎么用?Java AccessDeniedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AccessDeniedException类属于org.acegisecurity包,在下文中一共展示了AccessDeniedException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleException

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
private void handleException(ServletRequest request, ServletResponse response, 
        FilterChain chain, AcegiSecurityException exception) 
throws IOException, ServletException 
{
    if (exception instanceof AccessDeniedException) {
        if (logger.isDebugEnabled()) {
            logger.debug("Access is denied; delegating to AccessDeniedHandler",
                    exception);
        }
        
        request.setAttribute("ACCESS_DENIED", true);
        
        accessDeniedHandler.handle(request, response, (AccessDeniedException) exception);
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:16,代码来源:AccessDeniedFilter.java

示例2: checkPermission

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
/**
 * Check permission.
 * Also prohibits the access if Jenkins has not been started yet.
 * @param p Permission to be checked
 * @throws AccessDeniedException Access denied
 */
private void checkPermission(Permission p) throws AccessDeniedException {
    final Jenkins j = Jenkins.getInstance();
    if (j == null) {
        throw new AccessDeniedException("Cannot retrieve Jenkins instance. "
                + "Probably, the service is starting or shutting down");
    }     
    j.checkPermission(p);
}
 
开发者ID:jenkinsci,项目名称:docker-traceability-plugin,代码行数:15,代码来源:DockerTraceabilityRootAction.java

示例3: getItem

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
@Override
public T getItem(String name) throws AccessDeniedException {
	for (T item : this.items) {
		if (name.equals(item.getName())) {
			return item;
		}
	}
	
	return null;
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:11,代码来源:MockItemGroup.java

示例4: decide

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public Object decide(Authentication authentication, Object object, ConfigAttributeDefinition config,
    Object returnedObject) throws AccessDeniedException {
    Iterator iter = this.providers.iterator();

    Object result = returnedObject;

    while (iter.hasNext()) {
        AfterInvocationProvider provider = (AfterInvocationProvider) iter.next();
        result = provider.decide(authentication, object, config, result);
    }

    return result;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:14,代码来源:CSMAfterInvocationProviderManager.java

示例5: checkPermission

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
    getACL().checkPermission(permission);
}
 
开发者ID:jenkinsci,项目名称:impersonation-plugin,代码行数:8,代码来源:ImpersonationAction.java

示例6: checkPermission

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
    getACL().checkPermission(permission);
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:5,代码来源:DockerTask.java

示例7: checkAccessKeyPing

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public void checkAccessKeyPing(@CheckForNull String accessKey) {
    if (!hasAccessKeyPing(accessKey)) {
        throw new AccessDeniedException(Messages.MetricsAccessKey_invalidAccessKey(accessKey));
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:6,代码来源:MetricsAccessKey.java

示例8: checkAccessKeyThreadDump

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public void checkAccessKeyThreadDump(@CheckForNull String accessKey) {
    if (!hasAccessKeyThreadDump(accessKey)) {
        throw new AccessDeniedException(Messages.MetricsAccessKey_invalidAccessKey(accessKey));
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:6,代码来源:MetricsAccessKey.java

示例9: checkAccessKeyHealthCheck

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public void checkAccessKeyHealthCheck(@CheckForNull String accessKey) {
    if (!hasAccessKeyHealthCheck(accessKey)) {
        throw new AccessDeniedException(Messages.MetricsAccessKey_invalidAccessKey(accessKey));
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:6,代码来源:MetricsAccessKey.java

示例10: checkAccessKeyMetrics

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public void checkAccessKeyMetrics(@CheckForNull String accessKey) {
    if (!hasAccessKeyMetrics(accessKey)) {
        throw new AccessDeniedException(Messages.MetricsAccessKey_invalidAccessKey(accessKey));
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:6,代码来源:MetricsAccessKey.java

示例11: checkPermission

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
@Override
public void checkPermission(Permission arg0) throws AccessDeniedException {
	// TODO Auto-generated method stub
	
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:6,代码来源:MockItemGroup.java

示例12: decide

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
public Object decide(Authentication authentication, Object object, ConfigAttributeDefinition config,
    Object returnedObject) throws AccessDeniedException {
    Iterator iter = config.getConfigAttributes();

    
  securityMap =  securityHelper.getPostMethodInvocationSecurityMap(methodInvocation, returnedObject);
 
    while (iter.hasNext()) {
    	
        ConfigAttribute attr = (ConfigAttribute) iter.next();

        if (this.supports(attr)) {
            // Need to process the Collection for this invocation
            if (returnedObject == null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Return object is null, skipping");
                }
                return null;
            }

            
            // Get GrantedAuthorities from Authentication Object and Match them with the SecurityMap
            GrantedAuthority[] authorities = authentication.getAuthorities();
            Collection<String> grantedAuthoritiesStringCollection = new ArrayList<String>();
            for(int i=0;i<authorities.length;i++){
            	grantedAuthoritiesStringCollection.add(authorities[i].getAuthority());
            }
            
            
            Collection securityRolesCollection = new ArrayList();
            Set keySet = securityMap.keySet();
    		Iterator iterator = keySet.iterator();
    		while(iterator.hasNext()){
    			String className = (String)iterator.next();
    			Collection classname = (Collection) securityMap.get(className);
    			Iterator authoritiesIterator = classname.iterator();
    			while(authoritiesIterator.hasNext()){
    				String privilege = (String)authoritiesIterator.next();
    				String authority = className + "_" + privilege;
    				securityRolesCollection.add(authority);		
    			}			
    		}
    		
    		boolean accessDenied = false;
    		
            Iterator securityRolesCollectionIterator = securityRolesCollection.iterator();
            while(securityRolesCollectionIterator.hasNext()){
            	String string = (String) securityRolesCollectionIterator.next();
            	if(!grantedAuthoritiesStringCollection.contains(string)){
            		accessDenied = true;
            	}
            }
            
            if(accessDenied){
            	throw new AccessDeniedException("User does not have access to some or all of returned object.");
            }
            
            return returnedObject;
        }
    }
    return returnedObject;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:63,代码来源:CSMAfterInvocationProvider.java

示例13: getService

import org.acegisecurity.AccessDeniedException; //导入依赖的package包/类
/**
 * Fetch a service <em>module</em> identified by its class, or interface,
 * identifier.
 * 
 * @param module
 * @return an IService implementation, or NULL if none found with the given
 * class name, interface name or identifier.
    * 
    * @throws AccessDeniedException in case the current user is not allowed 
    * to access the resource.
 */
IService getService(Class<? extends IService> moudule) throws AccessDeniedException;
 
开发者ID:luox12,项目名称:onecmdb,代码行数:13,代码来源:ISession.java


注:本文中的org.acegisecurity.AccessDeniedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。