mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[Task 72503] added the default Anon READ policy for the site object
This commit is contained in:
@@ -14,13 +14,16 @@ import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.AbstractUnitTest;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.SiteService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -143,4 +146,17 @@ public class SiteTest extends AbstractUnitTest {
|
||||
assertThat("testGetURL 0", s.getURL(), equalTo(ConfigurationManager.getProperty("dspace.ui.url")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnonymousReadRights() throws Exception {
|
||||
List<Group> groupList = authorizeService.getAuthorizedGroups(context, s, Constants.READ);
|
||||
boolean foundAnonInList = false;
|
||||
for (Group group : groupList) {
|
||||
if (StringUtils.equalsIgnoreCase(group.getName(), "Anonymous")) {
|
||||
foundAnonInList = true;
|
||||
}
|
||||
}
|
||||
assertTrue(foundAnonInList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user