Examples of ACL


Examples of co.cask.cdap.api.security.ACL

   * @param principal the principal to set the ACL for
   * @param entityId the entityId to set the ACL on
   * @param permissions the list of permissions to allow the user access to entityId
   */
  public ACL setAcl(Principal principal, EntityId entityId, Iterable<PermissionType> permissions) {
    ACL acl = new ACL(principal, permissions);
    setAcl(new Key(entityId.getQualifiedId(), principal.getQualifiedId()), acl);
    return acl;
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    Assert.assertNotNull(acl);
    server.destroy();
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    acl.validate(user, user, null);
    acl.validate(user, user, user);

    server.destroy();
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    acl.validate(user, "root", user);

    server.destroy();
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    String group = groups.getGroups(user).get(0);
    acl.validate(user, "root", "bar," + group);
    server.destroy();
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    acl.validate(user, "root", "nobody");
    server.destroy();
  }
View Full Code Here

Examples of com.cloudera.lib.service.ACL

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    acl.validate(user, "root", null);
    server.destroy();
  }
View Full Code Here

Examples of com.ecyrd.jspwiki.auth.acl.Acl

        {
            m_currentElement.addContent( "[" + ruleLine + "]" );
        }

        if( !m_parseAccessRules ) return m_currentElement;
        Acl acl;
        WikiPage          page = m_context.getRealPage();
        // UserDatabase      db = m_context.getEngine().getUserDatabase();

        if( ruleLine.startsWith( "{" ) )
            ruleLine = ruleLine.substring( 1 );
        if( ruleLine.endsWith( "}" ) )
            ruleLine = ruleLine.substring( 0, ruleLine.length() - 1 );

        if( log.isDebugEnabled() ) log.debug("page="+page.getName()+", ACL = "+ruleLine);

        try
        {
            acl = m_engine.getAclManager().parseAcl( page, ruleLine );

            page.setAcl( acl );

            if( log.isDebugEnabled() ) log.debug( acl.toString() );
        }
        catch( WikiSecurityException wse )
        {
            return makeError( wse.getMessage() );
        }
View Full Code Here

Examples of com.emc.atmos.api.Acl

        this.object = object;
    }

    public synchronized ObjectMetadata getMetadata() {
        if ( metadata == null ) {
            Acl acl = new Acl( RestUtil.parseAclHeader( getFirstHeader( RestUtil.XHEADER_USER_ACL ) ),
                               RestUtil.parseAclHeader( getFirstHeader( RestUtil.XHEADER_GROUP_ACL ) ) );

            Map<String, Metadata> metaMap = new TreeMap<String, Metadata>();
            metaMap.putAll( RestUtil.parseMetadataHeader( getFirstHeader( RestUtil.XHEADER_META ), false ) );
            metaMap.putAll( RestUtil.parseMetadataHeader( getFirstHeader( RestUtil.XHEADER_LISTABLE_META ), true ) );
View Full Code Here

Examples of com.emc.esu.api.Acl

        return newAcl;
    }

    private Acl adaptAcl( com.emc.atmos.api.Acl acl ) {
        if ( acl == null ) return null;
        Acl newAcl = new Acl();
        for ( String name : acl.getGroupAcl().keySet() ) {
            newAcl.addGrant( new Grant( new Grantee( name, Grantee.GRANT_TYPE.GROUP ),
                                        acl.getGroupAcl().get( name ).toString() ) );
        }
        for ( String name : acl.getUserAcl().keySet() ) {
            newAcl.addGrant( new Grant( new Grantee( name, Grantee.GRANT_TYPE.USER ),
                                        acl.getUserAcl().get( name ).toString() ) );
        }
        return newAcl;
    }
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.