Examples of Role


Examples of org.nutz.ngqa.bean.Role

  public boolean isAuth(AuthContext authContext) {
    String[] needRoles = authContext.getAuth().value();
    Role[] hasRoles = authContext.getUser().getRoles();
    Map<String, Role> roles = authContext.getRoles();
    for (String roleName : needRoles) {
      Role role = roles.get(roleName);
      for (Role role2 : hasRoles) {
        if (!role.getId().equals(role2.getId()))
          return false;
      }
    }
    return true;
  }
View Full Code Here

Examples of org.nxplanner.domain.Role

        // Search for additional roles
        List roles = getRoles(context, user);
        for (int i = 0; i < roles.size(); i++) {
            String roleName = (String)roles.get(i);
            subject.getPrincipals().add(new Role(roleName));
        }
        // Create and return a suitable Principal for this user
        return subject;
    }
View Full Code Here

Examples of org.openbravo.model.ad.access.Role

      final Client client = (Client) bob;
      client.setName(newName);
      client.setDescription(newName);
      client.setSearchKey(newName);
    } else if (bob instanceof Role) {
      final Role role = (Role) bob;
      if (role.getName().indexOf(originalName) == -1) {
        role.setName(getNewName() + "_" + role.getName());
      } else {
        role.setName(replace(role.getName(), originalName));
      }
    } else if (bob instanceof User) {
      final User user = (User) bob;
      if (user.getUsername() == null) {
        return;
View Full Code Here

Examples of org.openengsb.domain.userprojects.model.Role

        deleteRolesFromPersistence(roles);
    }

    @Override
    public void deleteRoleByName(String roleName) {
        deleteRole(new Role(roleName));
    }
View Full Code Here

Examples of org.openiaml.model.model.users.Role

    DomainType obj = (DomainType) createElement( container, DomainPackage.eINSTANCE.getDomainType(), ModelPackage.eINSTANCE.getInternetApplication_Types() );
    return obj;
  }

  public Role generatedRole(GeneratesElements by, InternetApplication container) throws InferenceException {
    Role obj = (Role) createElement( container, UsersPackage.eINSTANCE.getRole(), ModelPackage.eINSTANCE.getInternetApplication_Types() );
    setGeneratedBy(obj, by);
    return obj;
  }
View Full Code Here

Examples of org.openmrs.Role

        String htmlform4 = "<htmlform><restrictByRole exclude=\"System Developer,Data Manager\">This is not shown to admin with multiple roles in exclude field</restrictByRole><restrictByRole exclude=\"Provider,Data Manager\">This is shown to admin with multiple roles in exclude field</restrictByRole></htmlform>";
        FormEntrySession session4 = new FormEntrySession(patient, htmlform4, null);
        Assert.assertEquals("<div class=\"htmlform\">This is shown to admin with multiple roles in exclude field</div>", session4.getHtmlToDisplay());

        /* check the restriction for a single user with multiple roles */
        Context.getAuthenticatedUser().addRole(new Role("Test Role", "A temporary role for the test"));

        String htmlform5 = "<htmlform><restrictByRole include=\"System Developer,Test Role\">This is shown to admin with multiple roles to single user in include field</restrictByRole><restrictByRole include=\"Provider,Data Manager\">This is not shown to admin with multiple roles to single user in include field</restrictByRole></htmlform>";
        FormEntrySession session5 = new FormEntrySession(patient, htmlform5, null);
        Assert.assertEquals("<div class=\"htmlform\">This is shown to admin with multiple roles to single user in include field</div>", session5.getHtmlToDisplay());

View Full Code Here

Examples of org.ops4j.pax.exam.sample2.model.Role

            String jobName = (String) entry.get("job");
            if ("Actor".equals(jobName)) {
                Actor actor = new Actor();
                actor.setId(id);
                doImportPerson(actor);
                Role role = new Role();
                role.setActor(actor);
                role.setMovie(movie);
                role.setName((String) entry.get("character"));
                em.persist(role);
                movie.getRoles().add(role);
            }
            else if ("Director".equals(jobName)) {
                Director director = new Director();
View Full Code Here

Examples of org.osforce.connect.entity.system.Role

    project.setCategory(category);
    // set features
    project.setFeatures(modules);
    // set default role to features
    for(ProjectFeature feature : modules) {
      Role role = roleService.getRole(feature.getRoleCode(), category.getId());
      feature.setRole(role);
    }
    request.setAttribute(AttributeKeys.PROJECT_KEY, project, WebRequest.SCOPE_SESSION);
    model.addAttribute(AttributeKeys.USER_KEY_READABLE, registerBean);
    return "system/user-register";
View Full Code Here

Examples of org.osgi.service.useradmin.Role

        if (roles.get(name) != null) {
            // role 'name' already exists, abort and return null
            return null;
        }

        Role role;
        switch (type) {
        case Role.USER:
            role = new UserImpl(name);
            break;
        case Role.GROUP:
View Full Code Here

Examples of org.palo.viewapi.Role

        List <String> roleIds = new ArrayList<String>();
        List <String> roleNames = new ArrayList<String>();
        IRoleManagement rm = MapperRegistry.getInstance().getRoleManagement();
        if (isPublic) {
          try {
            Role r = (Role) rm.findByName("VIEWER");
            roleIds.add(r.getId());
            roleNames.add(r.getName());
          } catch (Throwable t) {
          }
        }
        if (isEditable) {
          try {
            Role r = (Role) rm.findByName("EDITOR");
            roleIds.add(r.getId());
            roleNames.add(r.getName());
          } catch (Throwable t) {
          }
        }
        importedXView.setRoleIds(roleIds);
        importedXView.setRoleNames(roleNames);       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.