/** * Is allowed manage (create, remove, edit) item's policies in the * current context? * * @param context the DSpace Context Object * @param item the item that the policy refer to * @throws AuthorizeException if authorization error * if the current context (current user) is not allowed to * manage the item's policies * @throws SQLException if database error * if a db error occur */ public static void authorizeManageItemPolicy(Context context, Item item) throws AuthorizeException, SQLException { if (AuthorizeConfiguration.canItemAdminManagePolicies()) { authorizeService.authorizeAction(context, item, Constants.ADMIN); } else if (AuthorizeConfiguration.canCollectionAdminManageItemPolicies()) { authorizeService.authorizeAction(context, item .getOwningCollection(), Constants.ADMIN); } else if (AuthorizeConfiguration.canCommunityAdminManageItemPolicies()) { authorizeService .authorizeAction(context, item.getOwningCollection() .getCommunities().get(0), Constants.ADMIN); } else if (!authorizeService.isAdmin(context)) { throw new AuthorizeException( "Only system admin are allowed to manage item policies"); } }