private Permissions appendSecurityPermissions(Collection omPermissions, Permissions permissions)
{
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(!Collections.list(permissions.elements()).contains(permission))
{
permissions.add(permission);
}