Skip to content

Commit

Permalink
SAK-31415 Turn on soft site deletion by default and hide tab if it's …
Browse files Browse the repository at this point in the history
…not enabled (sakaiproject#2925)
  • Loading branch information
bgarciaentornos authored and juanjmerono committed Jul 4, 2016
1 parent c00fa0e commit a438287
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ public Site addSite(String id, Site other) throws IdInvalidException, IdUsedExce
public boolean allowRemoveSite(String id)
{
String lock = SECURE_REMOVE_SITE;
if(serverConfigurationService().getBoolean("site.soft.deletion", false))
if(serverConfigurationService().getBoolean("site.soft.deletion", true))
{
try
{
Expand All @@ -1364,7 +1364,7 @@ public void removeSite(Site site) throws PermissionException, IdUnusedException
unlock(SECURE_REMOVE_SITE, site.getReference());

// if soft site deletes are active
if(serverConfigurationService().getBoolean("site.soft.deletion", false)) {
if(serverConfigurationService().getBoolean("site.soft.deletion", true)) {

M_log.debug("Soft site deletes are enabled.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public void tearDown() throws IdUnusedException, PermissionException, InUseExcep
_ags.removeAuthzGroup(_chs.getReference(PHOTOS_COLLECTION));
_chs.removeCollection(IMAGES_COLLECTION);
_ags.removeAuthzGroup(_chs.getReference(IMAGES_COLLECTION));
// Mark as deleted.
_ss.removeSite(_ss.getSite(SITE_ID));
// Remove the deleted site.
_ss.removeSite(_ss.getSite(SITE_ID));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,9 @@ public void setUp() throws Exception {
startSession();
}

/**
* This does not test anything, it just makes sure we have one active test in the class
*/
@Test
public void testNothing() {
Assert.assertEquals(1, 1);
}

/**
* DISABLED this test since it no longer works, the functionality still does though - KNL-1162
*/
@Test
public void disabledTestSiteDeletionTriggersSiteAliasDeletion()
public void testSiteDeletionTriggersSiteAliasDeletion()
throws IdInvalidException, IdUsedException, PermissionException {
IdManager idManager = getService(IdManager.class);
SiteService siteService = getService(SiteService.class);
Expand All @@ -92,6 +82,9 @@ public void disabledTestSiteDeletionTriggersSiteAliasDeletion()

// the "real" code exercise
try {
// Mark as deleted.
siteService.removeSite(site);
// Remove the deleted site.
siteService.removeSite(site);
} catch (IdUnusedException e) {
// TODO Auto-generated catch block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ private String buildContextForTemplate(String preIndex, int index, VelocityPortl
Hashtable views = new Hashtable();

// Allow a user to see their deleted sites.
if (ServerConfigurationService.getBoolean("site.soft.deletion", false)) {
if (ServerConfigurationService.getBoolean("site.soft.deletion", true)) {
views.put(SiteConstants.SITE_TYPE_DELETED, rb.getString("java.sites.deleted"));
if (SiteConstants.SITE_TYPE_DELETED.equals((String) state.getAttribute(STATE_VIEW_SELECTED))) {
context.put("canSeeSoftlyDeletedSites", true);
Expand Down Expand Up @@ -1531,7 +1531,7 @@ private String buildContextForTemplate(String preIndex, int index, VelocityPortl
}
}
// Allow SuperUser to see all deleted sites.
if (ServerConfigurationService.getBoolean("site.soft.deletion", false)) {
if (ServerConfigurationService.getBoolean("site.soft.deletion", true)) {
views.put(SiteConstants.SITE_TYPE_DELETED, rb.getString("java.sites.deleted"));
}

Expand Down Expand Up @@ -1797,7 +1797,7 @@ private String buildContextForTemplate(String preIndex, int index, VelocityPortl
String user = SessionManager.getCurrentSessionUserId();
String workspace = SiteService.getUserSiteId(user);
// Are we attempting to softly delete a site.
boolean softlyDeleting = ServerConfigurationService.getBoolean("site.soft.deletion", false);
boolean softlyDeleting = ServerConfigurationService.getBoolean("site.soft.deletion", true);
if (removals != null && removals.length != 0) {
for (int i = 0; i < removals.length; i++) {
String id = (String) removals[i];
Expand Down

0 comments on commit a438287

Please sign in to comment.