本文整理匯總了Java中net.sf.acegisecurity.ConfigAttributeDefinition類的典型用法代碼示例。如果您正苦於以下問題:Java ConfigAttributeDefinition類的具體用法?Java ConfigAttributeDefinition怎麽用?Java ConfigAttributeDefinition使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConfigAttributeDefinition類屬於net.sf.acegisecurity包,在下文中一共展示了ConfigAttributeDefinition類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decide
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
@Override
public Object decide(
Authentication authentication,
Object object,
ConfigAttributeDefinition config,
Object returnedObject) throws AccessDeniedException
{
// If this object has already been marked, then leave it
if (returnedObject == null)
{
return null;
}
else if (returnedObject instanceof PermissionCheckedValue)
{
return returnedObject;
}
else if (object instanceof Collection<?>)
{
// Mark it
return PermissionCheckedValueMixin.create(returnedObject);
}
else
{
return returnedObject;
}
}
示例2: extractSupportedDefinitions
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
@SuppressWarnings("rawtypes")
private List<ConfigAttributeDefintion> extractSupportedDefinitions(ConfigAttributeDefinition config)
{
List<ConfigAttributeDefintion> definitions = new ArrayList<ConfigAttributeDefintion>();
Iterator iter = config.getConfigAttributes();
while (iter.hasNext())
{
ConfigAttribute attr = (ConfigAttribute) iter.next();
if (this.supports(attr))
{
definitions.add(new ConfigAttributeDefintion(attr));
}
}
return definitions;
}
示例3: decide
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
throws AccessDeniedException
{
Map<Set<String>, ResultSet> map = returnedObject.getResults();
Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f);
for (Set<String> group : map.keySet())
{
ResultSet raw = map.get(group);
ResultSet permed;
if (PagingLuceneResultSet.class.isAssignableFrom(raw.getClass()))
{
permed = decide(authentication, object, config, (PagingLuceneResultSet)raw);
}
else
{
permed = decide(authentication, object, config, raw);
}
answer.put(group, permed);
}
return new QueryEngineResults(answer);
}
示例4: extractSupportedDefinitions
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
private List<ConfigAttributeDefintion> extractSupportedDefinitions(ConfigAttributeDefinition config)
{
List<ConfigAttributeDefintion> definitions = new ArrayList<ConfigAttributeDefintion>(2);
Iterator iter = config.getConfigAttributes();
while (iter.hasNext())
{
ConfigAttribute attr = (ConfigAttribute) iter.next();
if (this.supports(attr))
{
definitions.add(new ConfigAttributeDefintion(attr));
}
}
return definitions;
}
示例5: decide
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
private NodeRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, NodeRef returnedObject)
{
if (returnedObject == null)
{
return null;
}
if (isUnfiltered(returnedObject))
{
return returnedObject;
}
List<ConfigAttributeDefintion> supportedDefinitions = extractSupportedDefinitions(config);
if (supportedDefinitions.size() == 0)
{
return returnedObject;
}
int parentResult = checkRead(nodeService.getPrimaryParent(returnedObject).getParentRef());
int childResult = checkRead(returnedObject);
checkSupportedDefinitions(supportedDefinitions, parentResult, childResult);
return returnedObject;
}
示例6: extractSupportedDefinitions
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
@SuppressWarnings("rawtypes")
private List<ConfigAttributeDefintion> extractSupportedDefinitions(ConfigAttributeDefinition config)
{
List<ConfigAttributeDefintion> definitions = new ArrayList<>();
Iterator iter = config.getConfigAttributes();
while (iter.hasNext())
{
ConfigAttribute attr = (ConfigAttribute) iter.next();
if (this.supports(attr))
{
definitions.add(new ConfigAttributeDefintion(attr));
}
}
return definitions;
}
示例7: pre
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
public AccessStatus pre(Object object)
{
ConfigAttributeDefinition attr = this.obtainObjectDefinitionSource().getAttributes(object);
if (this.getAccessDecisionManager() instanceof AffirmativeBasedAccessDecisionManger)
{
return ((AffirmativeBasedAccessDecisionManger)getAccessDecisionManager()).pre(object, attr);
}
else
{
return AccessStatus.ALLOWED;
}
}
示例8: pre
import net.sf.acegisecurity.ConfigAttributeDefinition; //導入依賴的package包/類
public AccessStatus pre(Object object, ConfigAttributeDefinition attr)
{
Iterator iter = this.getDecisionVoters().iterator();
int deny = 0;
while (iter.hasNext())
{
AccessDecisionVoter voter = (AccessDecisionVoter) iter.next();
int result = voter.vote(AuthenticationUtil.getFullAuthentication(), object, attr);
switch (result)
{
case AccessDecisionVoter.ACCESS_GRANTED:
return AccessStatus.ALLOWED;
case AccessDecisionVoter.ACCESS_DENIED:
deny++;
break;
default:
break;
}
}
if (deny > 0)
{
return AccessStatus.DENIED;
}
// To get this far, every AccessDecisionVoter abstained
if (this.isAllowIfAllAbstainDecisions())
{
return AccessStatus.ALLOWED;
}
else
{
return AccessStatus.DENIED;
}
}