org.codehaus.plexus.redback.rbac.Operation类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.codehaus.plexus.redback.rbac.Operation类的一些代码示例,展示了Operation类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operation类的具体详情如下:
包路径:org.codehaus.plexus.redback.rbac.Operation
类名称: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

  1. public int compare( Object o1, Object o2 )
  2. {
  3. if ( !( o1 instanceof Operation ) )
  4. {
  5. return 0;
  6. }
  7. if ( !( o2 instanceof Operation ) )
  8. {
  9. return 0;
  10. }
  11. if ( ( o1 == null ) && ( o2 == null ) )
  12. {
  13. return 0;
  14. }
  15. if ( ( o1 == null ) && ( o2 != null ) )
  16. {
  17. return -1;
  18. }
  19. if ( ( o1 != null ) && ( o2 == null ) )
  20. {
  21. return 1;
  22. }
  23. Operation r1 = (Operation) o1;
  24. Operation r2 = (Operation) o2;
  25. return r1.getName().compareToIgnoreCase( r2.getName() );
  26. }

代码示例来源:origin: org.codehaus.redback/redback-xmlrpc-services

  1. public List<Operation> getOperations()
  2. throws Exception
  3. {
  4. List<org.codehaus.plexus.redback.rbac.Operation> operations = rbacManager.getAllOperations();
  5. List<Operation> simpleOperations = new ArrayList<Operation>();
  6. for ( org.codehaus.plexus.redback.rbac.Operation operation : operations )
  7. {
  8. simpleOperations.add(
  9. new Operation( operation.getName(), operation.getDescription(), operation.isPermanent() ) );
  10. }
  11. return simpleOperations;
  12. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-memory

  1. public Operation createOperation( String name )
  2. throws RbacManagerException
  3. {
  4. Operation operation;
  5. try
  6. {
  7. operation = getOperation( name );
  8. }
  9. catch ( RbacObjectNotFoundException e )
  10. {
  11. operation = new MemoryOperation();
  12. operation.setName( name );
  13. }
  14. return operation;
  15. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-memory

  1. public void removeOperation( Operation operation )
  2. throws RbacObjectNotFoundException, RbacManagerException
  3. {
  4. RBACObjectAssertions.assertValid( "Remove Operation", operation );
  5. if ( operation.isPermanent() )
  6. {
  7. throw new RbacPermanentException( "Unable to delete permanent operation [" + operation.getName() + "]" );
  8. }
  9. assertOpertionExists( operation.getName() );
  10. operations.remove( operation.getName() );
  11. }

代码示例来源:origin: org.codehaus.redback/redback-xwork-integration

  1. if ( operation != null )
  2. operationName = operation.getName();
  3. operationDescription = operation.getDescription();

代码示例来源:origin: org.codehaus.redback/redback-struts2-integration

  1. public String save()
  2. {
  3. try
  4. {
  5. Operation temp = manager.createOperation( operationName );
  6. temp.setDescription( description );
  7. manager.saveOperation( temp );
  8. }
  9. catch ( RbacManagerException e )
  10. {
  11. addActionError( getText( "cannot.save.operation", Arrays.asList( (Object) operationName ) ) );
  12. log.error( "System error:", e );
  13. allOperations = Collections.emptyList();
  14. }
  15. return LIST;
  16. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-role-manager

  1. operation.setPermanent( profileOperation.isPermanent() );
  2. operation.setDescription( profileOperation.getDescription() );
  3. operation = rbacManager.saveOperation( operation );

代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo

  1. public void removeOperation( Operation operation )
  2. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  3. {
  4. RBACObjectAssertions.assertValid( operation );
  5. if ( operation.isPermanent() )
  6. {
  7. throw new RbacPermanentException( "Unable to delete permanent operation [" + operation.getName() + "]" );
  8. }
  9. jdo.removeObject( operation );
  10. }

代码示例来源:origin: org.codehaus.redback/redback-struts2-integration

  1. if ( operation != null )
  2. operationName = operation.getName();
  3. operationDescription = operation.getDescription();

代码示例来源:origin: org.codehaus.redback/redback-xwork-integration

  1. public String save()
  2. {
  3. try
  4. {
  5. Operation temp = manager.createOperation( operationName );
  6. temp.setDescription( description );
  7. manager.saveOperation( temp );
  8. }
  9. catch ( RbacManagerException e )
  10. {
  11. List list = new ArrayList();
  12. list.add( operationName );
  13. addActionError( getText( "cannot.save.operation", list ) );
  14. getLogger().error( "System error:", e );
  15. allOperations = Collections.EMPTY_LIST;
  16. }
  17. return LIST;
  18. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-cached

  1. private void invalidateCachedOperation( Operation operation )
  2. {
  3. if ( operation != null )
  4. {
  5. operationsCache.remove( operation.getName() );
  6. }
  7. }

代码示例来源:origin: org.codehaus.redback/redback-xmlrpc-services

  1. public Operation getOperation( String operationName )
  2. throws Exception
  3. {
  4. org.codehaus.plexus.redback.rbac.Operation operation = rbacManager.getOperation( operationName );
  5. Operation simpleOperation =
  6. new Operation( operation.getName(), operation.getDescription(), operation.isPermanent() );
  7. return simpleOperation;
  8. }

代码示例来源:origin: org.codehaus.redback/redback-xwork-integration

  1. if ( StringUtils.isNotEmpty( operationDescription ) )
  2. operation.setDescription( operationDescription );

代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo

  1. /**
  2. * Creates an implementation specific {@link Operation}.
  3. * <p/>
  4. * Note: this method does not add the {@link Operation} to the underlying store.
  5. * a call to {@link #saveOperation(Operation)} is required to track the operation created
  6. * with this method call.
  7. *
  8. * @param name the name.
  9. * @return the new Operation.
  10. * @throws RbacManagerException
  11. */
  12. public Operation createOperation( String name )
  13. throws RbacManagerException
  14. {
  15. Operation operation;
  16. try
  17. {
  18. operation = getOperation( name );
  19. }
  20. catch ( RbacObjectNotFoundException e )
  21. {
  22. operation = new JdoOperation();
  23. operation.setName( name );
  24. }
  25. return operation;
  26. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-model

  1. private Map<String, List<Permission>> getPermissionMapByOperation( Collection<Permission> permissions )
  2. {
  3. Map<String, List<Permission>> userPermMap = new HashMap<String, List<Permission>>();
  4. for ( Permission permission : permissions )
  5. {
  6. List<Permission> permList = userPermMap.get( permission.getOperation().getName() );
  7. if ( permList != null )
  8. {
  9. permList.add( permission );
  10. }
  11. else
  12. {
  13. List<Permission> newPermList = new ArrayList<Permission>();
  14. newPermList.add( permission );
  15. userPermMap.put( permission.getOperation().getName(), newPermList );
  16. }
  17. }
  18. return userPermMap;
  19. }

代码示例来源:origin: org.codehaus.redback/redback-struts2-integration

  1. if ( StringUtils.isNotEmpty( operationDescription ) )
  2. operation.setDescription( operationDescription );

代码示例来源:origin: org.codehaus.redback/redback-rbac-jdo

  1. operation.setName( operationName );

代码示例来源:origin: org.codehaus.redback/redback-rbac-memory

  1. public Operation saveOperation( Operation operation )
  2. throws RbacManagerException
  3. {
  4. triggerInit();
  5. RBACObjectAssertions.assertValid( "Save Operation", operation );
  6. operations.put( operation.getName(), operation );
  7. return operation;
  8. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-model

  1. public static void assertValid( String scope, Operation operation )
  2. throws RbacObjectInvalidException
  3. {
  4. if ( operation == null )
  5. {
  6. throw new RbacObjectInvalidException( scope, "Null Operation object is invalid." );
  7. }
  8. if ( StringUtils.isEmpty( operation.getName() ) )
  9. {
  10. throw new RbacObjectInvalidException( scope, "Operation.name must not be empty." );
  11. }
  12. }

代码示例来源:origin: org.codehaus.redback/redback-rbac-cached

  1. public boolean operationExists( Operation operation )
  2. {
  3. if ( operation == null )
  4. {
  5. return false;
  6. }
  7. if ( operationsCache.hasKey( operation.getName() ) )
  8. {
  9. return true;
  10. }
  11. return this.rbacImpl.operationExists( operation );
  12. }

相关文章