{
HashSet permissions = new HashSet();
Iterator internalPermissionsIter = omPermissions.iterator();
while (internalPermissionsIter.hasNext())
{
InternalPermission internalPermission = (InternalPermission) internalPermissionsIter.next();
Permission permission = null;
try
{
Class permissionClass = Class.forName(internalPermission.getClassname());
Class[] parameterTypes = { String.class, String.class };
Constructor permissionConstructor = permissionClass.getConstructor(parameterTypes);
Object[] initArgs = { internalPermission.getName(), internalPermission.getActions() };
permission = (Permission) permissionConstructor.newInstance(initArgs);
if(permissions.add(permission))
{
if (log.isDebugEnabled())
{