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