org.codehaus.plexus.redback.rbac.Operation.getName()方法的使用及代码示例

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

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

Operation.getName介绍

[英]name of the operation that is used in the act of authorization

'modify-foo', 'change-password'

NOTE: This field is considered the Primary Key for this object.
[中]授权行为中使用的操作的名称
“修改foo”,“更改密码”
注意:此字段被视为此对象的主键。

代码示例

代码示例来源: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-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-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-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-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-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-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. }

代码示例来源: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-model

  1. public boolean operationExists( String name )
  2. {
  3. try
  4. {
  5. for ( Operation operation : getAllOperations() )
  6. {
  7. if ( StringUtils.equals( operation.getName(), name ) )
  8. {
  9. return true;
  10. }
  11. }
  12. }
  13. catch ( RbacManagerException e )
  14. {
  15. return false;
  16. }
  17. return false;
  18. }

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

  1. serializer.writeAttribute( "name", jdoPermission.getOperation().getName() );
  2. serializer.writeEndElement();

代码示例来源: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-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-xmlrpc-services

  1. public List<Permission> getPermissions()
  2. throws Exception
  3. {
  4. List<org.codehaus.plexus.redback.rbac.Permission> permissions = rbacManager.getAllPermissions();
  5. List<Permission> simplePermissions = new ArrayList<Permission>();
  6. for ( org.codehaus.plexus.redback.rbac.Permission permission : permissions )
  7. {
  8. simplePermissions.add( new Permission( permission.getName(), permission.getDescription(), permission
  9. .getOperation().getName(), permission.getResource().getIdentifier() ) );
  10. }
  11. return simplePermissions;
  12. }

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

  1. if ( permission.getOperation().getName().equals( operation.toString() ) )

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

  1. public EditRoleDetails( Role role )
  2. {
  3. super.setName( role.getName() );
  4. super.setDescription( role.getDescription() );
  5. Iterator it;
  6. it = role.getChildRoleNames().iterator();
  7. while ( it.hasNext() )
  8. {
  9. super.addChildRoleName( (String) it.next() );
  10. }
  11. it = role.getPermissions().iterator();
  12. while ( it.hasNext() )
  13. {
  14. Permission perm = (Permission) it.next();
  15. super.addPermission( perm.getName(), perm.getOperation().getName(), perm.getResource().getIdentifier() );
  16. }
  17. }

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

  1. public Permission getPermission( String permissionName )
  2. throws Exception
  3. {
  4. org.codehaus.plexus.redback.rbac.Permission permission = rbacManager.getPermission( permissionName );
  5. Permission simplePermission = new Permission( permission.getName(), permission.getDescription(), permission
  6. .getOperation().getName(), permission.getResource().getIdentifier() );
  7. return simplePermission;
  8. }

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

  1. public Permission createPermission( String name, String operationName, String resourceIdentifier )
  2. throws RbacManagerException
  3. {
  4. Permission permission;
  5. try
  6. {
  7. permission = getPermission( name );
  8. if ( StringUtils.equals( operationName, permission.getOperation().getName() ) )
  9. {
  10. throw new RbacManagerException( "Attempted to create a permission named '" + name +
  11. "' with an operation named '" + operationName + "', but that overides the existing '" + name +
  12. "' permission with operation '" + permission.getOperation().getName() + "'" );
  13. }
  14. }
  15. catch ( RbacObjectNotFoundException e )
  16. {
  17. permission = new MemoryPermission();
  18. permission.setName( name );
  19. permission.setOperation( createOperation( operationName ) );
  20. permission.setResource( createResource( resourceIdentifier ) );
  21. }
  22. return permission;
  23. }

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

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

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

  1. operation.setName( p.getOperation().getName() );
  2. permission.setOperation( operation );

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

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

相关文章