Package org.glassfish.security.common

Examples of org.glassfish.security.common.Role


    /**
     * Add a new abstrct role to me.
     */
    public void addSecurityRole(SecurityRole securityRole) {
        Role r = new Role(securityRole.getName());
        r.setDescription(securityRole.getDescription());
        super.addRole(r);
    }
View Full Code Here


    public boolean areResourceReferencesValid() {
    // run through each of the ejb's role references, checking that the roles exist in this bundle
    for (EjbDescriptor ejbDescriptor : getEjbs()) {
        for (Iterator roleRefs = ejbDescriptor.getRoleReferences().iterator(); roleRefs.hasNext();) {
        RoleReference roleReference = (RoleReference) roleRefs.next();
        Role referredRole = roleReference.getRole();
        if (!referredRole.getName().equals("")
            && !super.getRoles().contains(referredRole) ) {
           
            _logger.log(Level.FINE,localStrings.getLocalString(
               "enterprise.deployment.badrolereference",
               "Warning: Bad role reference to {0}", new Object[] {referredRole}));
View Full Code Here

     * and then delegates to addRole(Role) to preserve the rest of the behavior of this class.
     *
     * @param descriptor SecurityRoleDescriptor that describes the username and description of the role
     */
    public void addRole(SecurityRoleDescriptor descriptor) {
        Role role = new Role(descriptor.getName());
        role.setDescription(descriptor.getDescription());
        this.addRole(role);
    }
View Full Code Here

    public void addDescriptor(Object newDescriptor) {
        if (newDescriptor instanceof SecurityRoleMapping) {
            SecurityRoleMapping roleMap = (SecurityRoleMapping) newDescriptor;
            if (descriptor!=null && !descriptor.isVirtual()) {
                descriptor.addSecurityRoleMapping(roleMap);
                Role role = new Role(roleMap.getRoleName());
                SecurityRoleMapper rm = descriptor.getRoleMapper();
                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames();
                    for (int i = 0; i < principals.size(); i++) {
                        rm.assignRole(principals.get(i).getPrincipal(),
View Full Code Here

        if (newDescriptor instanceof SecurityRoleMapping) {
            SecurityRoleMapping roleMap = (SecurityRoleMapping)newDescriptor;
            descriptor.addSecurityRoleMapping(roleMap);
            Application app = descriptor.getApplication();
            if (app!=null) {
                Role role = new Role(roleMap.getRoleName());
                SecurityRoleMapper rm = app.getRoleMapper();
                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames();
                    for (int i = 0; i < principals.size(); i++) {
                        rm.assignRole(principals.get(i).getPrincipal(),
View Full Code Here

    public boolean areResourceReferencesValid() {
    // run through each of the ejb's role references, checking that the roles exist in this bundle
    for (EjbDescriptor ejbDescriptor : getEjbs()) {
        for (Iterator roleRefs = ejbDescriptor.getRoleReferences().iterator(); roleRefs.hasNext();) {
        RoleReference roleReference = (RoleReference) roleRefs.next();
        Role referredRole = roleReference.getRole();
        if (!referredRole.getName().equals("")
            && !super.getRoles().contains(referredRole) ) {
           
            _logger.log(Level.FINE,localStrings.getLocalString(
               "enterprise.deployment.badrolereference",
               "Warning: Bad role reference to {0}", new Object[] {referredRole}));
View Full Code Here

     * @param value it's associated value
     */   
    @Override
    public void setElementValue(XMLElement element, String value) {
        if (TagNames.ROLE_NAME.equals(element.getQName())) {
            Role role = new Role(value);
            descriptor.addMethodPermission(new MethodPermission(role));
        } else {
            super.setElementValue(element, value);
        }
    }
View Full Code Here

    public boolean areResourceReferencesValid() {
    // run through each of the ejb's role references, checking that the roles exist in this bundle
    for (EjbDescriptor ejbDescriptor : getEjbs()) {
        for (Iterator roleRefs = ejbDescriptor.getRoleReferences().iterator(); roleRefs.hasNext();) {
        RoleReference roleReference = (RoleReference) roleRefs.next();
        Role referredRole = roleReference.getRole();
        if (!referredRole.getName().equals("")
            && !super.getRoles().contains(referredRole) ) {
           
            _logger.log(Level.FINE,localStrings.getLocalString(
               "enterprise.deployment.badrolereference",
               "Warning: Bad role reference to {0}", new Object[] {referredRole}));
View Full Code Here

     * and then delegates to addRole(Role) to preserve the rest of the behavior of this class.
     *
     * @param descriptor SecurityRoleDescriptor that describes the username and description of the role
     */
    public void addRole(SecurityRoleDescriptor descriptor) {
        Role role = new Role(descriptor.getName());
        role.setDescription(descriptor.getDescription());
        this.addRole(role);
    }
View Full Code Here

        }
        return this.appRoles;
    }

    public void addAppRole(SecurityRoleDescriptor descriptor) {
        Role role = new Role(descriptor.getName());
        role.setDescription(descriptor.getDescription());
        getAppRoles().add(role);
    }
View Full Code Here

TOP

Related Classes of org.glassfish.security.common.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.