mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 03:53:07 +00:00
When an Item has no default READ policies, identify it by handle so an
admin need not dig into the database to find it in the UI. git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6071 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -2179,14 +2179,18 @@ public class Item extends DSpaceObject
|
|||||||
public void inheritCollectionDefaultPolicies(Collection c)
|
public void inheritCollectionDefaultPolicies(Collection c)
|
||||||
throws java.sql.SQLException, AuthorizeException
|
throws java.sql.SQLException, AuthorizeException
|
||||||
{
|
{
|
||||||
|
List<ResourcePolicy> policies;
|
||||||
|
|
||||||
// remove the submit authorization policies
|
// remove the submit authorization policies
|
||||||
// and replace them with the collection's default READ policies
|
// and replace them with the collection's default READ policies
|
||||||
List<ResourcePolicy> policies = AuthorizeManager.getPoliciesActionFilter(ourContext, c, Constants.DEFAULT_ITEM_READ);
|
policies = AuthorizeManager.getPoliciesActionFilter(ourContext, c,
|
||||||
|
Constants.DEFAULT_ITEM_READ);
|
||||||
|
|
||||||
// MUST have default policies
|
// MUST have default policies
|
||||||
if (policies.size() < 1)
|
if (policies.size() < 1)
|
||||||
{
|
{
|
||||||
throw new java.sql.SQLException("Collection " + c.getID()
|
throw new java.sql.SQLException("Collection " + c.getID()
|
||||||
|
+ " (" + c.getHandle() + ")"
|
||||||
+ " has no default item READ policies");
|
+ " has no default item READ policies");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2199,11 +2203,13 @@ public class Item extends DSpaceObject
|
|||||||
|
|
||||||
replaceAllItemPolicies(policies);
|
replaceAllItemPolicies(policies);
|
||||||
|
|
||||||
policies = AuthorizeManager.getPoliciesActionFilter(ourContext, c, Constants.DEFAULT_BITSTREAM_READ);
|
policies = AuthorizeManager.getPoliciesActionFilter(ourContext, c,
|
||||||
|
Constants.DEFAULT_BITSTREAM_READ);
|
||||||
|
|
||||||
if (policies.size() < 1)
|
if (policies.size() < 1)
|
||||||
{
|
{
|
||||||
throw new java.sql.SQLException("Collection " + c.getID()
|
throw new java.sql.SQLException("Collection " + c.getID()
|
||||||
|
+ " (" + c.getHandle() + ")"
|
||||||
+ " has no default bitstream READ policies");
|
+ " has no default bitstream READ policies");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user