当前位置: 首页>>代码示例>>Java>>正文


Java LDAPException.INSUFFICIENT_ACCESS_RIGHTS属性代码示例

本文整理汇总了Java中com.novell.ldap.LDAPException.INSUFFICIENT_ACCESS_RIGHTS属性的典型用法代码示例。如果您正苦于以下问题:Java LDAPException.INSUFFICIENT_ACCESS_RIGHTS属性的具体用法?Java LDAPException.INSUFFICIENT_ACCESS_RIGHTS怎么用?Java LDAPException.INSUFFICIENT_ACCESS_RIGHTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.novell.ldap.LDAPException的用法示例。


在下文中一共展示了LDAPException.INSUFFICIENT_ACCESS_RIGHTS属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAddBoundFail

@Test
public void testAddBoundFail() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	con.bind(3,"uid=testuser,ou=users,dc=domain,dc=com","secret".getBytes());
	LDAPAttributeSet attribs = new LDAPAttributeSet();
	attribs.add(new LDAPAttribute("cn","Test Add"));
	attribs.add(new LDAPAttribute("sn","Add"));
	attribs.add(new LDAPAttribute("uid","tadd"));
	attribs.add(new LDAPAttribute("objectClass","inetOrgPerson"));
	
	LDAPEntry entry = new LDAPEntry("uid=tadd,ou=users,dc=domain,dc=com",attribs);
	
	try {
		con.add(entry);
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail("add succeeded");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:26,代码来源:TestACLPlugin.java

示例2: testAddAnonFail

public void testAddAnonFail() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	LDAPAttributeSet attribs = new LDAPAttributeSet();
	attribs.add(new LDAPAttribute("cn","Test Add"));
	attribs.add(new LDAPAttribute("sn","Add"));
	attribs.add(new LDAPAttribute("uid","tadd"));
	attribs.add(new LDAPAttribute("objectClass","inetOrgPerson"));
	
	LDAPEntry entry = new LDAPEntry("uid=tadd,ou=users,dc=domain,dc=com",attribs);
	
	try {
		con.add(entry);
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail("add succeeded");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:24,代码来源:TestACLPlugin.java

示例3: testAddBoundFail

public void testAddBoundFail() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	con.bind(3,"uid=testuser,ou=users,dc=domain,dc=com","secret".getBytes());
	LDAPAttributeSet attribs = new LDAPAttributeSet();
	attribs.add(new LDAPAttribute("cn","Test Add"));
	attribs.add(new LDAPAttribute("sn","Add"));
	attribs.add(new LDAPAttribute("uid","tadd"));
	attribs.add(new LDAPAttribute("objectClass","inetOrgPerson"));
	
	LDAPEntry entry = new LDAPEntry("uid=tadd,ou=users,dc=domain,dc=com",attribs);
	
	try {
		con.add(entry);
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail("add succeeded");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:25,代码来源:TestACLPlugin.java

示例4: testSearchGroupsBound

public void testSearchGroupsBound() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	con.bind(3,"uid=testuser,ou=users,dc=domain,dc=com","secret".getBytes());
	
	
	try {
		LDAPSearchResults res = con.search("ou=groups,dc=domain,dc=com",1,"(objectClass=*)",new String[0],false);
		if (res.hasMore()) {
			fail("has results : " + res.next());
		}
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail ("did not throw error");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:22,代码来源:TestACLPlugin.java

示例5: testAddAnonFail

@Test
public void testAddAnonFail() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	LDAPAttributeSet attribs = new LDAPAttributeSet();
	attribs.add(new LDAPAttribute("cn","Test Add"));
	attribs.add(new LDAPAttribute("sn","Add"));
	attribs.add(new LDAPAttribute("uid","tadd"));
	attribs.add(new LDAPAttribute("objectClass","inetOrgPerson"));
	
	LDAPEntry entry = new LDAPEntry("uid=tadd,ou=users,dc=domain,dc=com",attribs);
	
	try {
		con.add(entry);
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail("add succeeded");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:25,代码来源:TestACLPlugin.java

示例6: testSearchGroupsBound

@Test
public void testSearchGroupsBound() throws Exception {
	LDAPConnection con = new LDAPConnection();
	con.connect("localhost",50983);
	con.bind(3,"uid=testuser,ou=users,dc=domain,dc=com","secret".getBytes());
	
	
	try {
		LDAPSearchResults res = con.search("ou=groups,dc=domain,dc=com",1,"(objectClass=*)",new String[0],false);
		if (res.hasMore()) {
			fail("has results : " + res.next());
		}
	} catch (LDAPException e) {
		if (e.getResultCode() != LDAPException.INSUFFICIENT_ACCESS_RIGHTS) {
			throw e;
		} else {
			return;
		}
	}
	
	fail ("did not throw error");
	con.disconnect();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:23,代码来源:TestACLPlugin.java

示例7: checkPermisions

private void checkPermisions(AccessControlItem aci,boolean permision,String errMsg) throws LDAPException {
	if (this.isNotAllowed(aci,permision)) {
		throw new LDAPException(errMsg,LDAPException.INSUFFICIENT_ACCESS_RIGHTS,"");
	}
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:5,代码来源:AccessMgmt.java


注:本文中的com.novell.ldap.LDAPException.INSUFFICIENT_ACCESS_RIGHTS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。