List of usage examples for org.springframework.security.access SecurityConfig SecurityConfig
public SecurityConfig(String config)
From source file:eu.freme.common.persistence.tools.AccessLevelHelper.java
public AccessLevelHelper() { readAccess = new SecurityConfig("ACCESS_READ"); writeAccess = new SecurityConfig("ACCESS_WRITE"); }
From source file:ch.astina.hesperid.web.services.springsecurity.RequestInvocationDefinition.java
public RequestInvocationDefinition(String key, String roles) { this.requestKey = new RequestKey(key); String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ',')); this.configAttributes = new ArrayList<ConfigAttribute>(); for (String attr : allAttrs) { this.configAttributes.add(new SecurityConfig(attr)); }/* www .ja v a 2s .co m*/ }
From source file:ch.ksfx.web.services.springsecurity.RequestInvocationDefinition.java
public RequestInvocationDefinition(String key, String roles) { this.requestKey = new RequestKey(key); String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ',')); this.configAttributes = new ArrayList<ConfigAttribute>(); for (String attr : allAttrs) { this.configAttributes.add(new SecurityConfig(attr)); }//from w ww. j ava2 s . co m }
From source file:nu.localhost.tapestry5.springsecurity.services.RequestInvocationDefinition.java
public RequestInvocationDefinition(String pattern, String roles, Long id) { this.requestMatcher = new AntPathRequestMatcher(pattern); String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ',')); this.configAttributes = new ArrayList<ConfigAttribute>(); for (String attr : allAttrs) { this.configAttributes.add(new SecurityConfig(attr)); }/*from w w w . jav a 2 s . co m*/ }
From source file:cn.net.withub.demo.bootsec.hello.security.CustomFilterInvocationSecurityMetadataSource.java
@Transactional private void loadResourceMatchAuthority() { resourceMap = new HashMap<String, Collection<ConfigAttribute>>(); for (Resource res : resourceRepository.findAll()) { Collection<ConfigAttribute> list; if (resourceMap.containsKey(res.getUrl())) { list = resourceMap.get(res.getUrl()); } else {/* ww w . j a v a 2 s .c o m*/ list = new ArrayList<ConfigAttribute>(); resourceMap.put(res.getUrl(), list); } for (Roleinfo role : res.getRoleinfoList()) { list.add(new SecurityConfig(role.getAuthority())); } } databaseChanged = false; }
From source file:org.duracloud.account.db.util.impl.AccountServiceSecuredImpl.java
private void throwIfAccessDenied(Object... args) { String methodName = getCurrentMethodName(); Set<ConfigAttribute> configAtts = new HashSet<ConfigAttribute>(); for (Object obj : methodMap.get(methodName)) { configAtts.add(new SecurityConfig((String) obj)); }//from w w w . j ava 2s . c om MethodInvocation invocation = new MethodInvocationImpl(this, methodName, args); int decision = voter.vote(authentication, invocation, configAtts); if (decision != AccessDecisionVoter.ACCESS_GRANTED) { throw new AccessDeniedException("Access denied"); } }
From source file:com.edgenius.wiki.security.Policy.java
public void addAttribute(String attribute) { SecurityConfig config = new SecurityConfig(attribute); attributes.add(config); }
From source file:grails.plugin.springsecurity.acl.access.method.SecuredAnnotationSecurityMetadataSource.java
protected List<ConfigAttribute> processAnnotation(final Annotation a) { if (!(a instanceof Secured)) { return null; }/* www .j av a 2s. com*/ String[] attributeTokens = ((Secured) a).value(); List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(attributeTokens.length); for (String token : attributeTokens) { attributes.add(new SecurityConfig(token)); } return attributes; }
From source file:org.osiam.resource_server.security.authorization.DynamicHTTPMethodScopeEnhancer.java
private void addMethodScope(final Object object, final Set<ConfigAttribute> dynamicConfigs) { final FilterInvocation f = (FilterInvocation) object; dynamicConfigs.add(new SecurityConfig("SCOPE_" + f.getRequest().getMethod().toUpperCase(Locale.ENGLISH))); }
From source file:com.edgenius.wiki.security.Policy.java
public boolean hasAttribute(String attribute) { SecurityConfig config = new SecurityConfig(attribute); return attributes.contains(config); }