本文整理了Java中org.codehaus.plexus.redback.rbac.Operation
类的一些代码示例,展示了Operation
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operation
类的具体详情如下:
包路径:org.codehaus.plexus.redback.rbac.Operation
类名称:Operation
[英]Operation
In RBAC the operation is an action or functionality that can be linked with a particular resource into an assignable Permission. Operations don't exist outside Permissions.
[中]活动
在RBAC中,操作是一种操作或功能,可以与特定资源链接成可分配的权限。权限之外不存在操作。
代码示例来源:origin: org.codehaus.redback/redback-xwork-integration
public int compare( Object o1, Object o2 )
{
if ( !( o1 instanceof Operation ) )
{
return 0;
}
if ( !( o2 instanceof Operation ) )
{
return 0;
}
if ( ( o1 == null ) && ( o2 == null ) )
{
return 0;
}
if ( ( o1 == null ) && ( o2 != null ) )
{
return -1;
}
if ( ( o1 != null ) && ( o2 == null ) )
{
return 1;
}
Operation r1 = (Operation) o1;
Operation r2 = (Operation) o2;
return r1.getName().compareToIgnoreCase( r2.getName() );
}
代码示例来源:origin: org.codehaus.redback/redback-xmlrpc-services
public List<Operation> getOperations()
throws Exception
{
List<org.codehaus.plexus.redback.rbac.Operation> operations = rbacManager.getAllOperations();
List<Operation> simpleOperations = new ArrayList<Operation>();
for ( org.codehaus.plexus.redback.rbac.Operation operation : operations )
{
simpleOperations.add(
new Operation( operation.getName(), operation.getDescription(), operation.isPermanent() ) );
}
return simpleOperations;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-memory
public Operation createOperation( String name )
throws RbacManagerException
{
Operation operation;
try
{
operation = getOperation( name );
}
catch ( RbacObjectNotFoundException e )
{
operation = new MemoryOperation();
operation.setName( name );
}
return operation;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-memory
public void removeOperation( Operation operation )
throws RbacObjectNotFoundException, RbacManagerException
{
RBACObjectAssertions.assertValid( "Remove Operation", operation );
if ( operation.isPermanent() )
{
throw new RbacPermanentException( "Unable to delete permanent operation [" + operation.getName() + "]" );
}
assertOpertionExists( operation.getName() );
operations.remove( operation.getName() );
}
代码示例来源:origin: org.codehaus.redback/redback-xwork-integration
if ( operation != null )
operationName = operation.getName();
operationDescription = operation.getDescription();
代码示例来源:origin: org.codehaus.redback/redback-struts2-integration
public String save()
{
try
{
Operation temp = manager.createOperation( operationName );
temp.setDescription( description );
manager.saveOperation( temp );
}
catch ( RbacManagerException e )
{
addActionError( getText( "cannot.save.operation", Arrays.asList( (Object) operationName ) ) );
log.error( "System error:", e );
allOperations = Collections.emptyList();
}
return LIST;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-role-manager
operation.setPermanent( profileOperation.isPermanent() );
operation.setDescription( profileOperation.getDescription() );
operation = rbacManager.saveOperation( operation );
代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo
public void removeOperation( Operation operation )
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
{
RBACObjectAssertions.assertValid( operation );
if ( operation.isPermanent() )
{
throw new RbacPermanentException( "Unable to delete permanent operation [" + operation.getName() + "]" );
}
jdo.removeObject( operation );
}
代码示例来源:origin: org.codehaus.redback/redback-struts2-integration
if ( operation != null )
operationName = operation.getName();
operationDescription = operation.getDescription();
代码示例来源:origin: org.codehaus.redback/redback-xwork-integration
public String save()
{
try
{
Operation temp = manager.createOperation( operationName );
temp.setDescription( description );
manager.saveOperation( temp );
}
catch ( RbacManagerException e )
{
List list = new ArrayList();
list.add( operationName );
addActionError( getText( "cannot.save.operation", list ) );
getLogger().error( "System error:", e );
allOperations = Collections.EMPTY_LIST;
}
return LIST;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-cached
private void invalidateCachedOperation( Operation operation )
{
if ( operation != null )
{
operationsCache.remove( operation.getName() );
}
}
代码示例来源:origin: org.codehaus.redback/redback-xmlrpc-services
public Operation getOperation( String operationName )
throws Exception
{
org.codehaus.plexus.redback.rbac.Operation operation = rbacManager.getOperation( operationName );
Operation simpleOperation =
new Operation( operation.getName(), operation.getDescription(), operation.isPermanent() );
return simpleOperation;
}
代码示例来源:origin: org.codehaus.redback/redback-xwork-integration
if ( StringUtils.isNotEmpty( operationDescription ) )
operation.setDescription( operationDescription );
代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo
/**
* Creates an implementation specific {@link Operation}.
* <p/>
* Note: this method does not add the {@link Operation} to the underlying store.
* a call to {@link #saveOperation(Operation)} is required to track the operation created
* with this method call.
*
* @param name the name.
* @return the new Operation.
* @throws RbacManagerException
*/
public Operation createOperation( String name )
throws RbacManagerException
{
Operation operation;
try
{
operation = getOperation( name );
}
catch ( RbacObjectNotFoundException e )
{
operation = new JdoOperation();
operation.setName( name );
}
return operation;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-model
private Map<String, List<Permission>> getPermissionMapByOperation( Collection<Permission> permissions )
{
Map<String, List<Permission>> userPermMap = new HashMap<String, List<Permission>>();
for ( Permission permission : permissions )
{
List<Permission> permList = userPermMap.get( permission.getOperation().getName() );
if ( permList != null )
{
permList.add( permission );
}
else
{
List<Permission> newPermList = new ArrayList<Permission>();
newPermList.add( permission );
userPermMap.put( permission.getOperation().getName(), newPermList );
}
}
return userPermMap;
}
代码示例来源:origin: org.codehaus.redback/redback-struts2-integration
if ( StringUtils.isNotEmpty( operationDescription ) )
operation.setDescription( operationDescription );
代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo
operation.setName( operationName );
代码示例来源:origin: org.codehaus.redback/redback-rbac-memory
public Operation saveOperation( Operation operation )
throws RbacManagerException
{
triggerInit();
RBACObjectAssertions.assertValid( "Save Operation", operation );
operations.put( operation.getName(), operation );
return operation;
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-model
public static void assertValid( String scope, Operation operation )
throws RbacObjectInvalidException
{
if ( operation == null )
{
throw new RbacObjectInvalidException( scope, "Null Operation object is invalid." );
}
if ( StringUtils.isEmpty( operation.getName() ) )
{
throw new RbacObjectInvalidException( scope, "Operation.name must not be empty." );
}
}
代码示例来源:origin: org.codehaus.redback/redback-rbac-cached
public boolean operationExists( Operation operation )
{
if ( operation == null )
{
return false;
}
if ( operationsCache.hasKey( operation.getName() ) )
{
return true;
}
return this.rbacImpl.operationExists( operation );
}
内容来源于网络,如有侵权,请联系作者删除!