Examples of Role


Examples of org.infinispan.security.Role

               if (roleNames != null) {
                  for (String roleName : roleNames) {
                     // Skip roles not defined for this cache
                     if (configuration != null && !configuration.roles().contains(roleName))
                        continue;
                     Role role = globalConfiguration.authorization().roles().get(roleName);
                     if (role != null) {
                        mask |= role.getMask();
                     }
                  }
               }
            }
            try {
View Full Code Here

Examples of org.infoglue.cms.entities.management.Role

        return getAllVOObjects(RoleImpl.class, "roleName", db);
    }

    public RoleVO create(RoleVO roleVO) throws ConstraintException, SystemException
    {
        Role role = new RoleImpl();
        role.setValueObject(roleVO);
        role = (Role) createEntity(role);
        return role.getValueObject();
    }    
View Full Code Here

Examples of org.internna.iwebmvc.model.Role

    @Transactional(propagation = Propagation.REQUIRED)
    @Override public void createAuthority(String authority) {
        Assert.hasText(authority);
        if (!isAuthority(authority)) {
            try {
                Role role = roleClass.newInstance();
                entityManager.persist(role.setRole(authority));
            } catch (Exception ex) {
                throw new IWebMvcException("Could not create new role", ex);
            }
        }
    }
View Full Code Here

Examples of org.itnaf.model.Role

                // get the list of roles the user is trying add
                Set userRoles = new HashSet();
                if (user.getRoles() != null) {
                    for (Iterator it = user.getRoles().iterator(); it.hasNext();) {
                        Role role = (Role) it.next();
                        userRoles.add(role.getName());
                    }
                }

                // get the list of roles the user currently has
                Set authorizedRoles = new HashSet();
View Full Code Here

Examples of org.jamwiki.model.Role

  /**
   *
   */
  private void modifyRole(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception {
    String updateRole = request.getParameter("updateRole");
    Role role = null;
    if (!StringUtils.isBlank(request.getParameter("Submit"))) {
      try {
        // once created a role name cannot be modified, so the text field
        // will be disabled in the form.
        boolean update = StringUtils.isBlank(request.getParameter("roleName"));
        String roleName = (update) ? updateRole : request.getParameter("roleName");
        role = new RoleImpl(roleName);
        role.setDescription(request.getParameter("roleDescription"));
        WikiUtil.validateRole(role);
        WikiBase.getDataHandler().writeRole(role, update);
        if (!StringUtils.isBlank(updateRole) && updateRole.equals(role.getAuthority())) {
          next.addObject("message", new WikiMessage("roles.message.roleupdated", role.getAuthority()));
        } else {
          next.addObject("message", new WikiMessage("roles.message.roleadded", role.getAuthority()));
        }
      } catch (WikiException e) {
        next.addObject("message", e.getWikiMessage());
      } catch (Exception e) {
        logger.severe("Failure while adding role", e);
        next.addObject("message", new WikiMessage("roles.message.rolefail", e.getMessage()));
      }
    } else if (!StringUtils.isBlank(updateRole)) {
      // FIXME - use a cached list of roles instead of iterating
      // load details for the selected role
      List<Role> roles = WikiBase.getDataHandler().getAllRoles();
      for (Role tempRole : roles) {
        if (tempRole.getAuthority().equals(updateRole)) {
          role = tempRole;
        }
      }
    }
    if (role != null) {
      next.addObject("roleName", role.getAuthority());
      next.addObject("roleDescription", role.getDescription());
    }
    this.view(request, next, pageInfo);
  }
View Full Code Here

Examples of org.java.demo.model.Role

    @Inject
    private Block dataGridBlock;

    @SetupRender
    void setupRender() {
        role = new Role();
    }
View Full Code Here

Examples of org.jboss.aerogear.security.shiro.model.Role

     * @return builder implementation
     */
    public GrantConfiguration roles(String[] roles) {
        list = new HashSet<Role>();
        for (String name : roles) {
            Role role = entityManager.createNamedQuery("Role.findByName", Role.class)
                    .setParameter("name", name)
                    .getSingleResult();
            list.add(role);
        }
        return this;
View Full Code Here

Examples of org.jboss.as.console.client.administration.role.model.Role

            boolean hasExcludes = !roleAssignment.getExcludes().isEmpty();
            List<Role> roles = new ArrayList<Role>(roleAssignment.getRoles());
            RoleComparator comperator = new RoleComparator();
            Collections.sort(roles, comperator);
            for (Iterator<Role> iterator = roles.iterator(); iterator.hasNext(); ) {
                Role role = iterator.next();
                builder.append(roleAsSafeHtml(role, true));
                if (iterator.hasNext() || hasExcludes) {
                    builder.append(SafeHtmlUtils.fromString(", "));
                }
            }
            if (hasExcludes) {
                List<Role> excludes = new ArrayList<Role>(roleAssignment.getExcludes());
                Collections.sort(excludes, comperator);
                for (Iterator<Role> iterator = excludes.iterator(); iterator.hasNext(); ) {
                    Role exclude = iterator.next();
                    builder.append(roleAsSafeHtml(exclude, false));
                    if (iterator.hasNext()) {
                        builder.append(SafeHtmlUtils.fromString(", "));
                    }
                }
View Full Code Here

Examples of org.jboss.as.console.client.rbac.Role

        private void addManagementModelRoleAssignment(final Principals principals, final RoleAssignments assignments,
                final Roles roles, final Property property) {
            boolean add = true;
            String roleName = property.getName();
            Role role = roles.getRole(roleName);
            if (role != null) {
                RoleAssignment.ManagementModel managementModel = new RoleAssignment.ManagementModel(role);
                ModelNode assignmentNode = property.getValue();
                if (assignmentNode.hasDefined("include")) {
                    List<Property> inclusions = assignmentNode.get("include").asPropertyList();
View Full Code Here

Examples of org.jboss.dashboard.users.Role

        this.name = name;
    }

    public String toString() {
        String desc = "";
        Role role = SecurityServices.lookup().getRolesManager().getRoleById(this.getName().substring(this.getName().indexOf('-') + 1));
        if (role != null) desc = role.getName();
        return StringUtils.isNotBlank(desc) ? desc : this.getName();
    }
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.