{
String roleName = (String)roles.next();
Role userRole = roleManager.getRole(roleName);
if (userRole != null)
{
Permission permission = new PortletPermission(paName + "::*", "view, edit");
if (!permissionManager.permissionExists(permission))
{
permissionManager.addPermission(permission);
permissionManager.grantPermission(userRole.getPrincipal(), permission);
}