Package com.agiletec.aps.system.services.role

Examples of com.agiletec.aps.system.services.role.Role


  }

  public void testService() throws ApsSystemException {
    RequestContext reqCtx = this.getRequestContext();

    Role role = new Role();
    role.setName("testRole");

    User user =  new User();
    user.addAutority(role);

    reqCtx.getRequest().getSession().setAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER, user);
View Full Code Here



  public void testServiceFailure() throws ApsSystemException {
    RequestContext reqCtx = this.getRequestContext();

    Role role = new Role();
    role.setName("testRole");
    User user =  new User();
    user.addAutority(role);
    reqCtx.getRequest().getSession().setAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER, user);

    Page page = new Page();
View Full Code Here

    Set<String> roleNames = this.getConfig().getRoles();
    if (null != roleNames) {
      Iterator<String> it = roleNames.iterator();
      while (it.hasNext()) {
        String rolename = it.next();
        Role role = this.getRoleManager().getRole(rolename);
        ((IApsAuthorityManager) this.getRoleManager()).setUserAuthorization(user.getUsername(), role);
      }
    }
  }
View Full Code Here

    StringBuffer rolesBuffer = new StringBuffer();
    boolean isFirstRole = true;
    IApsAuthority[] auths = currentUser.getAuthorities();
    for (int i=0; i<auths.length; i++) {
      if (auths[i] instanceof Role) {
        Role role = (Role) auths[i];
        if (!isFirstRole) rolesBuffer.append(" - ");
        rolesBuffer.append(role.getName());
        isFirstRole = false;
      }
    }
    statsRecord.setRole(rolesBuffer.toString());
    NumberFormat formato = NumberFormat.getIntegerInstance(java.util.Locale.ITALIAN);
View Full Code Here

    return this.getContentManager().getSmallContentTypes();
  }
 
  @Override
  public Role getRole(String typeCode) {
    Role role = null;
    String roleName = this.getWorkflowManager().getRole(typeCode);
    if (roleName!=null) {
      role = this.getRoleManager().getRole(roleName);
    }
    return role;
View Full Code Here

 
  protected boolean validateSetAssignableParams(Ticket ticket) {
    boolean allowed = false;
    String roleName = this.getRoleName();
    if (null!=roleName) {
      Role role = this.getRoleManager().getRole(roleName);
      if (null!=role && role.hasPermission(JpWttSystemConstants.WTT_OPERATOR_PERMISSION)) {
        allowed = true;
      }
    }
    if (!allowed) {
      this.addFieldError("roleName", this.getText("Errors.ticketSetAssiglable.roleNotFound"));
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.role.Role

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.