use of com.sun.enterprise.deployment.SecurityRoleDescriptor in project Payara by payara.
the class WebBundleDescriptorImpl method getSecurityRoles.
/**
* Returns an Enumeration of my SecurityRole objects.
* @return
*/
@Override
public Enumeration<SecurityRoleDescriptor> getSecurityRoles() {
Vector<SecurityRoleDescriptor> securityRoles = new Vector<SecurityRoleDescriptor>();
for (Role r : super.getRoles()) {
SecurityRoleDescriptor srd = new SecurityRoleDescriptor(r);
securityRoles.add(srd);
}
return securityRoles.elements();
}
use of com.sun.enterprise.deployment.SecurityRoleDescriptor in project Payara by payara.
the class AuthConstraintNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node in the DOM tree
* @param nodeName node name for the root element of this xml fragment
* @param descriptor the descriptor to write
* @return the DOM tree top node
*/
@Override
public Node writeDescriptor(Node parent, String nodeName, AuthorizationConstraintImpl descriptor) {
Node myNode = appendChild(parent, nodeName);
writeLocalizedDescriptions(myNode, descriptor);
// role-name*
for (Enumeration roles = descriptor.getSecurityRoles(); roles.hasMoreElements(); ) {
SecurityRoleDescriptor role = (SecurityRoleDescriptor) roles.nextElement();
appendTextChild(myNode, WebTagNames.ROLE_NAME, role.getName());
}
return myNode;
}
use of com.sun.enterprise.deployment.SecurityRoleDescriptor in project Payara by payara.
the class AuthorizationConstraintImpl method addSecurityRole.
/**
* Adds a role to the authorization constraint
* @param the role name to be added
*/
public void addSecurityRole(String roleName) {
SecurityRoleDescriptor sr = new SecurityRoleDescriptor();
sr.setName(roleName);
addSecurityRole(sr);
}
Aggregations