/** * Can the current user remove the admins group of the community? * please note that the create/edit actions need separate check * * @param context the DSpace Context Object * @param community the community * @throws AuthorizeException if authorization error * if the current user is not allowed to remove the * collection's admins group * @throws SQLException if database error * if a db error occur * @see #authorizeManageAdminGroup(Context, Community) */ public static void authorizeRemoveAdminGroup(Context context, Community community) throws SQLException, AuthorizeException { List<Community> parentCommunities = community.getParentCommunities(); Community parentCommunity = null; if (0 < parentCommunities.size()) { parentCommunity = parentCommunities.get(0); } if (AuthorizeConfiguration.canCommunityAdminManageAdminGroup() && parentCommunity != null) { authorizeService.authorizeAction(context, parentCommunity, Constants.ADMIN); } else if (!authorizeService.isAdmin(context)) { throw new AuthorizeException( "Only system admin can remove the admin group of the community"); } }
/** * Can the current user create/edit the admins group of the community? * please note that the remove action need a separate check * * @param context the DSpace Context Object * @param community the community * @throws AuthorizeException if authorization error * if the current user is not allowed to create/edit the * community's admins group * @throws SQLException if database error * if a db error occur * @see #authorizeRemoveAdminGroup(Context, Collection) */ public static void authorizeManageAdminGroup(Context context, Community community) throws AuthorizeException, SQLException { if (AuthorizeConfiguration.canCommunityAdminManageAdminGroup()) { authorizeService.authorizeAction(context, community, Constants.ADMIN); } else if (!authorizeService.isAdmin(context)) { throw new AuthorizeException( "Only system admin are allowed to manage community admin"); } }
|| AuthorizeConfiguration.canCollectionAdminManageSubmitters() || AuthorizeConfiguration.canCollectionAdminManageWorkflows() || AuthorizeConfiguration.canCommunityAdminManageAdminGroup() || AuthorizeConfiguration .canCommunityAdminManageCollectionAdminGroup() } else if (AuthorizeConfiguration.canCommunityAdminManageAdminGroup()) {