本文整理了Java中java.security.acl.Group.removeMember()
方法的一些代码示例,展示了Group.removeMember()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.removeMember()
方法的具体详情如下:
包路径:java.security.acl.Group
类名称:Group
方法名:removeMember
[英]Removes a member from this group.
[中]
代码示例来源:origin: org.jboss.security/jbosssx-bare
/**
* Remove all the principals from the group
* @param grp
* @return
*/
public static Group removePrincipals(Group grp)
{
HashSet<Principal> removeset = new HashSet<Principal>();
Enumeration<? extends Principal> en = grp.members();
while(en.hasMoreElements())
{
removeset.add(en.nextElement());
}
for(Principal p:removeset)
grp.removeMember(p);
return grp;
}
代码示例来源:origin: org.picketbox/picketbox
/**
* Remove all the principals from the group
* @param grp
* @return
*/
public static Group removePrincipals(Group grp)
{
HashSet<Principal> removeset = new HashSet<Principal>();
Enumeration<? extends Principal> en = grp.members();
while(en.hasMoreElements())
{
removeset.add(en.nextElement());
}
for(Principal p:removeset)
grp.removeMember(p);
return grp;
}
代码示例来源:origin: org.jboss.security/jbosssx-bare
/**
* Process the group with the roles that are mapped in the
* properies file
* @param group Group that needs to be processed
* @param props Properties file
*/
private void processRoles(Group group,Properties props) throws Exception
{
Enumeration<?> enumer = props.propertyNames();
while(enumer.hasMoreElements())
{
String roleKey = (String)enumer.nextElement();
String comma_separated_roles = props.getProperty(roleKey);
Principal pIdentity = createIdentity(roleKey);
if(group.isMember(pIdentity))
Util.parseGroupMembers(group,comma_separated_roles,this);
if(REPLACE_ROLE)
group.removeMember(pIdentity);
}
}
}
代码示例来源:origin: org.jboss.seam/jboss-seam
/**
* Removes a role from the authenticated user
*
* @param role The name of the role to remove
*/
public void removeRole(String role)
{
for ( Group sg : getSubject().getPrincipals(Group.class) )
{
if ( ROLES_GROUP.equals( sg.getName() ) )
{
Enumeration e = sg.members();
while (e.hasMoreElements())
{
Principal member = (Principal) e.nextElement();
if (member.getName().equals(role))
{
sg.removeMember(member);
break;
}
}
}
}
}
代码示例来源:origin: org.jboss.microcontainer/jboss-reliance-identity
/**
* Removes a role from the user's subject and their security context
*
* @param role The name of the role to remove
*/
public void removeRole(String role)
{
for (Group sg : getSubject().getPrincipals(Group.class))
{
if (ROLES_GROUP.equals(sg.getName()))
{
Enumeration e = sg.members();
while (e.hasMoreElements())
{
Principal member = (Principal)e.nextElement();
if (member.getName().equals(role))
{
sg.removeMember(member);
break;
}
}
}
}
}
代码示例来源:origin: org.picketbox/picketbox
/**
* Remove the roles from the Group
* @param roles Group of roles
* @param removeRoles
* @return Group with roles removed
*/
public static Group removeRoles(Group roles, String[] removeRoles)
{
//Assume that the roles all belong to the same principal class
Class<?> pClass = getPrincipalClass(roles);
for(String str:removeRoles)
{
roles.removeMember(instantiatePrincipal(pClass,str));
}
return roles;
}
代码示例来源:origin: org.jboss.security/jbosssx-bare
/**
* Remove the roles from the Group
* @param roles Group of roles
* @param removeRoles
* @return Group with roles removed
*/
public static Group removeRoles(Group roles, String[] removeRoles)
{
//Assume that the roles all belong to the same principal class
Class<?> pClass = getPrincipalClass(roles);
for(String str:removeRoles)
{
roles.removeMember(instantiatePrincipal(pClass,str));
}
return roles;
}
代码示例来源:origin: org.picketbox/picketbox
/**
* Process the group with the roles that are mapped in the
* properies file
* @param group Group that needs to be processed
* @param props Properties file
*/
private void processRoles(Group group,Properties props) //throws Exception
{
Enumeration<?> enumer = props.propertyNames();
while(enumer.hasMoreElements())
{
String roleKey = (String)enumer.nextElement();
String comma_separated_roles = props.getProperty(roleKey);
try {
Principal pIdentity = createIdentity(roleKey);
if (group != null)
{
if(group.isMember(pIdentity))
Util.parseGroupMembers(group,comma_separated_roles,this);
if(REPLACE_ROLE)
group.removeMember(pIdentity);
}
}
catch(Exception e) {
PicketBoxLogger.LOGGER.debugFailureToCreatePrincipal(roleKey, e);
}
}
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
callerGroup.removeMember(p);
代码示例来源:origin: org.switchyard/switchyard-security
} finally {
if (runAsAdded) {
rolesGroup.removeMember(runAsPrincipal);
代码示例来源:origin: jboss-switchyard/core
} finally {
if (runAsAdded) {
rolesGroup.removeMember(runAsPrincipal);
内容来源于网络,如有侵权,请联系作者删除!