Package jcifs.smb

Examples of jcifs.smb.ACE


  private static final String GLOBAL_NAMESPACE = "global";
  private static final String LOCAL_NAMESPACE = "local";

  public void testACLForFileLevelAClOnly() throws IOException {
    SmbFileDelegate smbFile = createMock(SmbFileDelegate.class);
    ACE fileAce = createACE("user1", AclScope.USER);
    ACE [] fileAces = {fileAce};
    expect(smbFile.getSecurity()).andReturn(fileAces);
    expect(smbFile.getURL()).andReturn(new URL("file","host","file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here


    verify(fileAce);
  }

  public void testACLForShareLevelAclOnly () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    ACE shareAce = createACE("user2", AclScope.USER);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file","host","file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(shareAce);
  }

  public void testACLForShareLevelGroupAclOnly () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    ACE shareAce = createACE("accountants", AclScope.GROUP);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file","host","file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(smbFile);
  }

  public void testACLForDomainNameStrippedOff () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    ACE shareAce = createACE("domain\\accountants", AclScope.GROUP);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file", "host", "file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(smbFile);
  }

  public void testACLForPresenceOfDenyShareLevelACE () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    ACE shareAce = createACE("John Doe", AclScope.USER, AclAccess.DENY);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file", "host", "file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(smbFile);
  }

  public void testACLForPresenceOfDenyFileLevelACE () throws IOException {
    SmbFileDelegate smbFile = createMock(SmbFileDelegate.class);
    ACE fileAce = createACE("accountants", AclScope.GROUP, AclAccess.DENY);
    ACE [] fileAces = {fileAce};
    expect(smbFile.getSecurity()).andReturn(fileAces);
    expect(smbFile.getURL()).andReturn(new URL("file", "host", "file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

  }

  public void testACLForSAMLTypeACL () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    String samlAceFormat = AclFormat.USER_AT_DOMAIN.getFormat();
    ACE shareAce = createACE("google\\accountants", AclScope.GROUP);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file", "host", "file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

  }

  public void testACLForHTTPBasicTypeACL () throws IOException {
    SmbFileDelegate smbFile = createNiceMock(SmbFileDelegate.class);
    String httpAceFormat = AclFormat.DOMAIN_BACKSLASH_USER.getFormat();
    ACE shareAce = createACE("google\\accountants", AclScope.GROUP);
    ACE [] shareAces = {shareAce};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file", "host", "file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(smbFile);
  }

  public void testACLForHTTPBasicUserAceAndSAMLGroupAce () throws IOException {
    SmbFileDelegate smbFile = createMock(SmbFileDelegate.class);
    ACE fileAce = createACE("google\\superUser", AclScope.USER);
    ACE fileAce1 = createACE("user2", AclScope.USER);
    ACE [] fileAces = {fileAce, fileAce1};
    expect(smbFile.getSecurity()).andReturn(fileAces);
    //To ensure that we get same SID for checking equality
    ACE shareAce = fileAce;
    ACE shareAce1 = createACE("google\\employees", AclScope.GROUP);
    ACE [] shareAces = {shareAce, shareAce1};
    expect(smbFile.getShareSecurity(true)).andReturn(shareAces);
    expect(smbFile.getURL()).andReturn(new URL("file","host","file"));
    expectLastCall().anyTimes();
    replay(smbFile);
View Full Code Here

    verify(shareAce1);
  }

  public void testACLForPresenceOfInheritedFolderLevelACE() throws IOException {
    SmbFileDelegate smbFile = createMock(SmbFileDelegate.class);
    ACE fileAce0 = createACE("accountants", AclScope.GROUP,
        AclAccess.PERMIT, AceType.ALL_INHERITED);
    ACE fileAce1 = createACE("sales", AclScope.GROUP,
        AclAccess.PERMIT, AceType.OBJECT_INHERITED);
    ACE fileAce2 = createACE("testing1", AclScope.GROUP,
        AclAccess.PERMIT, AceType.DIRECT);
    ACE fileAce3 = createACE("testing2", AclScope.GROUP,
        AclAccess.PERMIT, AceType.INHERIT_ONLY);
    ACE fileAce4 = createACE("testing3", AclScope.GROUP,
        AclAccess.PERMIT, AceType.CONTAINER_INHERITED);
    ACE fileAce5 = createACE("testing4", AclScope.GROUP,
        AclAccess.PERMIT, AceType.INHERITED);
    ACE[] fileAces =
        {fileAce0, fileAce1, fileAce2, fileAce3, fileAce4, fileAce5};
    expect(smbFile.getSecurity()).andReturn(fileAces);
    expect(smbFile.isDirectory()).andReturn(true);
View Full Code Here

TOP

Related Classes of jcifs.smb.ACE

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.