mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 04:23:13 +00:00
[DS-270] Make delegate admin permissions configurable
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4309 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -640,4 +640,51 @@ public class Bitstream extends DSpaceObject
|
||||
public int getStoreNumber() {
|
||||
return bRow.getIntColumn("store_number");
|
||||
}
|
||||
|
||||
public DSpaceObject getParentObject() throws SQLException
|
||||
{
|
||||
Bundle[] bundles = getBundles();
|
||||
if (bundles != null && (bundles.length > 0 && bundles[0] != null))
|
||||
{
|
||||
// the ADMIN action is not allowed on Bundle object so skip to the item
|
||||
Item[] items = bundles[0].getItems();
|
||||
if (items != null && items.length > 0)
|
||||
{
|
||||
return items[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// is the bitstream a logo for a community or a collection?
|
||||
TableRow qResult = DatabaseManager.querySingle(bContext,
|
||||
"SELECT collection_id FROM collection " +
|
||||
"WHERE logo_bitstream_id = ?",getID());
|
||||
if (qResult != null)
|
||||
{
|
||||
Collection collection = Collection.find(bContext,qResult.getIntColumn("collection_id"));
|
||||
return collection;
|
||||
}
|
||||
else
|
||||
{
|
||||
// is the bitstream related to a community?
|
||||
qResult = DatabaseManager.querySingle(bContext,
|
||||
"SELECT community_id FROM community " +
|
||||
"WHERE logo_bitstream_id = ?",getID());
|
||||
|
||||
if (qResult != null)
|
||||
{
|
||||
Community community = Community.find(bContext,qResult.getIntColumn("community_id"));
|
||||
return community;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user