Skip to content

Commit

Permalink
Merge pull request DSpace#9296 from amgciadev/fix-9290-b
Browse files Browse the repository at this point in the history
Fix resource policy type not set for bitstreams when importing items
  • Loading branch information
tdonohue authored May 1, 2024
2 parents 74e5575 + 679df52 commit 7952df1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,8 @@ protected void processOptions(Context c, Item myItem, List<String> options)
} else {
logInfo("\tSetting special permissions for "
+ bitstreamName);
setPermission(c, myGroup, actionID, bs);
String rpType = useWorkflow ? ResourcePolicy.TYPE_SUBMISSION : ResourcePolicy.TYPE_INHERITED;
setPermission(c, myGroup, rpType, actionID, bs);
}
}

Expand Down Expand Up @@ -1801,13 +1802,14 @@ protected void processOptions(Context c, Item myItem, List<String> options)
*
* @param c DSpace Context
* @param g Dspace Group
* @param rpType resource policy type string
* @param actionID action identifier
* @param bs Bitstream
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
* @see org.dspace.core.Constants
*/
protected void setPermission(Context c, Group g, int actionID, Bitstream bs)
protected void setPermission(Context c, Group g, String rpType, int actionID, Bitstream bs)
throws SQLException, AuthorizeException {
if (!isTest) {
// remove the default policy
Expand All @@ -1819,6 +1821,7 @@ protected void setPermission(Context c, Group g, int actionID, Bitstream bs)
rp.setdSpaceObject(bs);
rp.setAction(actionID);
rp.setGroup(g);
rp.setRpType(rpType);

resourcePolicyService.update(c, rp);
} else {
Expand Down

0 comments on commit 7952df1

Please sign in to comment.