PortletEntry userPortletEntry = new BasePortletEntry();
assertNotNull( "Have userPortletEntry", userPortletEntry);
userPortletEntry.setName( USER_PORTLET);
userPortletEntry.setSecurity( userSecurity);
Parameter adminParam = new BaseParameter();
assertNotNull( "Have adminParameter", adminParam);
adminParam.setName("AdminParam");
adminParam.setValue("adminValue");
adminParam.setSecurity(adminSecurity);
userPortletEntry.addParameter(adminParam);
Parameter userParam = new BaseParameter();
assertNotNull( "Have userParameter", userParam);
userParam.setName("UserParam");
userParam.setValue("userValue");
userParam.setSecurity(userSecurity);
userPortletEntry.addParameter(userParam);
assertEquals( "Admin user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( adminUser, new PortalResource( userPortletEntry, adminParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
assertEquals( "Turbine user customize access to admin parameter", false, JetspeedPortalAccessController.checkPermission( turbineUser, new PortalResource( userPortletEntry, adminParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
assertEquals( "Admin user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( adminUser, new PortalResource( userPortletEntry, userParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
assertEquals( "Turbine user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( turbineUser, new PortalResource( userPortletEntry, userParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));